Photo by Lucian Alexe on Unsplash
Connect Next.js app with Flask backend.
Connect backend with next.js app using next.config.js
Now I will connect the flask backend with the next.js app and the code snippit is given below:
const nextConfig = {
reactStrictMode: false,
async rewrites(){
return [
{
source:'/api/:slug*',
destination: 'http://localhost:8000/:slug*'
}
]
}
}
module.exports = nextConfig