Next.js Discord

Discord Forum

Fullstack hosting vs seperate hosting

Answered
Masai Lion posted this in #help-forum
Open in Discord
Masai LionOP
Hey,

I wanted to host my project. I have a frontend and a separate backend. However, I thought about hosting both the frontend and backend on the same origin in order to have faster API calls (especially because I am calling the API in the Next.js middleware in order to check a session).

What do you think? Hosting it, e.g., Vercel and Hetzner, or hosting both on one server?
Answered by Anay-208 | Ping in replies
I mistakenly added seperate before.

You can host on the same VPS only
View full answer

32 Replies

Masai LionOP
Can you recommend any hosting provider? Because it seems like a hustle to host a websocket on vercel
But yes, with Vercel you’ll get the best optimisations.
@Masai Lion Can you recommend any hosting provider? Because it seems like a hustle to host a websocket on vercel
Vercel doesn’t support web sockets.
Best way for web sockets is in a vps only like in hetzner, or digitalocean

Or you can maybe use server less Lambda
With aws api gateway for ws
Masai LionOP
Hm yeah. That's what I thought too.
If you get really less traffic on websocket, server less like aws api gateway would def be cheaper.
Masai LionOP
Unfortunaly the websocket is basically the main "part" of the app
But I recommend hosting websocket in a different app then nextjs
Masai LionOP
Therefore it will have to handle a lot of traffic
Masai LionOP
This kind of feels off. You know what I mean?
Masai LionOP
I mean if I have the backend and frontend as one pillar of the app and the websocket on a totally different server it seems off
Answer
Masai LionOP
kk thank you
@Masai Lion @Anay-208 | Ping in replies can you guys help me ?

im trying to get through next.js/learn but keep getting build failed on vercel im literally following every instruction but the build keeps failing i dont get it.
Masai LionOP
This is the wrong channel for this types of questions but you can send me a dm with your errors
im new here i apologise. you know what its like when you just want to get things sorted. i will dm you. thanks so much
@Masai Lion This is the wrong channel for this types of questions but you can send me a dm with your errors
what do you mean? This is the right channel, but he need to create a different forum
Oh wait, @Masai Lion actually, he need to create a different forum
He can’t ask in this post, but create another
My bad, you actually mentioned channel rather than thread that’s why I was confused
@Anay-208 | Ping in replies Both in the same server is a good idea
Can you mark my message as a solution?
Masai LionOP
How do I do that?
Make sure to do that on my above message
Masai LionOP
did it
Thanks