4 ms·
I'm curious what do you think is missing from Next.js that would make it better at connecting to databases and backend APIs? There is a bit of evidence that pe
by magicink81 5y ago
I'm curious what do you think is missing from Next.js that would make it better at connecting to databases and backend APIs?
There is a bit of evidence that people are building heavily used web apps with Next.js that connect to databases, backend APIs, and expose APIs of their own, for example:
https://nextjs.org/showcase https://nextjs.org/showcase
- andrewingram 5y agoYeah, other than the nested route thing, there doesn’t seem to be that much difference between Next and Remix when it comes to talking to a database.
- magicink81 5y agoNext.js has had nested routes since version 6. Not sure I see the difference in what Remix is offering? https://nextjs.org/docs/routing/introduction#nested-routes https://nextjs.org/docs/routing/introduction#nested-routes
- cyral 5y agoI don't think the nested routes mean the same thing on the NextJS page. To my knowledge, NextJS doesn't support nested routers which is really what many are after. Like in the Remix demo, there are various content areas with nested content, which would be controlled by the URL. You can create url parameters manually like /account/:tab/:id but it's kinda hacky as you have to use router.params['param-here'] to get the parameter and the handle the rendering yourself. You'd really want an account router to handle each tab in the account area, and then each tab in that area has its own nested router than can display the relevant content (based on the ID of the invoice for example).
- pssdbt 5y agoI think what you're looking for is nested routes _and_ layouts. It's possible in Next but IMO it's not the prettiest. https://nextjs.org/docs/basic-features/layouts#per-page-layouts https://nextjs.org/docs/basic-features/layouts#per-page-layo...
- dimitrisnl 5y ago1. Vendor-lock 2. Iffy folder structure. Some stuff both front-end & back-end will live under /pages. 3. Suboptimal experience when you have to use middleware. Disclaimer, haven't tried the latest updates, but I assume it's vercel only.