Before, when I made apps with create-react-app, I would have a setupProxy.js file that would route API requests similar to this const proxy = require('http-proxy-middleware'); module.exports = function(app) { app.use('/api', proxy({ target: 'http://localhost:8000', changeOrigin: true, }) ); }; But that doesn't seem to work with next.js. When I do the same thing, I get various errors. Googling a solution, a lot say to use a custom server of some...
Originally asked by cclloyd on Stack Exchange (stackoverflow) (CC BY-SA 4.0).