Closed mmoyles87 closed 5 years ago
@dubvfan87 Eventually, yes. No particular deadline.
Having app
and api
separated is not simply a matter of organization.
When app
and api
are separated, page rendering in app
does not block request processing in api
.
And vice versa, request processing in api
does not block page rendering in app
.
More on server blocking: https://async-await.com/article/how-to-scale-a-node-js-server-isolate-expensive-tasks-in-forked-process
Separation of app
and api
is done to create more scalable, production-ready app.
api
routes that you mentioned in v9, from my quick glance, is opinionated feature that has opinion on where you should keep code for your app's routes. This new feature prescribes storing code for routes in pages/api
, we store routes in lib/api
. Not a big deal.
Link to the example with pages/api
:
https://github.com/zeit/next.js/tree/canary/examples/api-routes
@dubvfan87 Next was recently upgraded to v9 in all web apps of saas
repo.
Thanks to @delgermurun
Nice thanks for the heads up, and thanks to @delgermurun !
Are there any plans to upgrade to next.js v9? It has some cool new features like support for api routes. I was thinking this could get rid of the need to run 2 separate apps.