I set up a server with next-connect. Now how can I move requests to the pages folder of my nextjs program? This is my server js file:
const nc = require("next-connect");
const {auth} = require("../app/middlewares/auth");
const handler = nc()
.use(auth)
.get((req, res) => {
console.log('->', req.session.get('user'))
// Render the requested page from the pages folder
}).post();
createServer(handler).listen(process.env.PORT);
Looks like you created a custom backend for your Next.js project probably using Node.js and express. This requires some critical changes throughout the project.
You can read the documentation here. https://nextjs.org/docs/advanced-features/custom-server