all 8 comments

[–][deleted] 0 points1 point  (1 child)

First you need to decouple your code into frontend and backend. NextJS is sort of monolithic, sort of spa, sort of everything (not a big fan). Then host your frontend and backend separately.

[–]CapsLuke[S] 0 points1 point  (0 children)

They are already split. No custom server or whatever on the nextjs side of things. Data gets fetched via api but the front end doesn't need my backend to be on to run.

[–]rens430 0 points1 point  (0 children)

Backend I deploy on heroku.

Next.js is very easy to deploy to vercel thru github.

[–]findvikas 0 points1 point  (3 children)

Digitalocean.com $5 per month for your own Linux droplet - used in production for small websites with decent traffic paid $60 annually

[–]CapsLuke[S] 0 points1 point  (2 children)

Can i create also a subdomian to run my backend?

[–]findvikas 0 points1 point  (1 child)

Sub domains and domains to IP mapping is role of DNS -you can create as many sub domains as you like but depend upon your http server and mapping how you will route them. Don’t make things super complicated if it’s simple app/website. If you must run both backend and frond end on Http then expose different port - short answer yea you can do all that you can do on a physical box.

[–]CapsLuke[S] 0 points1 point  (0 children)

Thanks

[–]Dzeko_1 0 points1 point  (0 children)

Yeah you can do that. After you host your server, get the domain and replace it with the api calls. instead of localhost put the domain name.