Next.js custom server

Viewed 109

I have a Next.js application and I want to connect it to a Node.js backend. If i put the file server.js in the same folder of the Next.js application I can run the application through these scripts:

"scripts": { "dev": "node server.js", "build": "next build", "start": "set NODE_ENV=production node server.js", "lint": "next lint" }

I want to put all the backend files in another folder (server.js too) , but in this case I can't run the application.

What I have to do? Thanks

0 Answers
Related