5 ms·
I just made basically the same comment, I'm pessimistic, but open minded. Hoping someone can drop some insight on this thread
by ldjkfkdsjnv 3y ago
I just made basically the same comment, I'm pessimistic, but open minded. Hoping someone can drop some insight on this thread
- cyral 3y agoVercel definitely pushes combining your backend into NextJS. It's probably a lot easier for beginners (Reminds me of all the tutorials pushing the MERN stack years ago) and also allows them to sell them on their managed hosting. However, you do not need to use NextJS as your "backend" like that. I'd assume most real apps are not doing that, you don't want your data access and logic coupled with your rendering code like that (whether it's NextJS or any other templating engine). Basically rather than making your DB calls directly in NextJS server side code, you can make an HTTP call to your API written in Go or whatever. This is how I've used Next for years and it makes a lot of sense. One common API for the website and mobile app. NextJS just becomes another consumer of the API. It does feel a little bit funny that your server-side code is calling your API, but think about any large tech company where there are layers upon layers of APIs that every request is flowing through.