I'd highly recommend avoiding custom servers in Next.js applications unless you have a very good use case.
The Next.js & Vercel teams have mentioned using a custom server opts you out of the Next.js happy path 🙁
Instead, simply use the getServerProps method or make a serverless func in pages/api and go from there.
getServerProps
pages/api
How do you create a dev proxy then? If I have my local next instance on port 3000 and my server on 8080?
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'd highly recommend avoiding custom servers in Next.js applications unless you have a very good use case.
The Next.js & Vercel teams have mentioned using a custom server opts you out of the Next.js happy path 🙁
Instead, simply use the
getServerProps
method or make a serverless func inpages/api
and go from there.How do you create a dev proxy then? If I have my local next instance on port 3000 and my server on 8080?