I know Next.js is front-end but when i used API of next.js it can response and can manage route or anything about back-end can do. Then i want to know "Next.js api is back-end ?"
Dynamic Routing has two folders pages
or api
. To stay on the front-end or client-side put your JavaScript / React DOM code in pages
. The back-end or server-side of Next.js is with the api
folder. The api
JavaScript code is not executed in the browser but with Node.js so this is not safe for static page generation. When Next.js is hosted in the cloud with Vercel then your server-side JS will render, but on Netlify or other static hosts the api
folder will be ignored or throw errors. It's like running Express.js code in the browser the JIT rendered will fail
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With