Introduction to Next.js
Next.js 14 is the latest version of the popular React-based framework for creating full-stack and production-ready web applications.
Next.js goes as far as providing even the possibility of creating the backend server through a new Next.js feature named Route Handlers (https://nextjs.org/docs/app/building-your-application/routing/route-handlers). This feature provides functions that allow you to create custom HTTP request handlers and create full-fledged APIs by using the Web Request and Response APIs.
These route handlers expose HTTP methods similarly to FastAPI (GET
, POST
, and so on) and allow building complex APIs that support middleware, caching, dynamic functions, setting and getting cookies and headers, and much more.
In the next few sections, you’ll be able to plug in your own, Python-based server and have that server run independently, maybe serving other applications simultaneously (a mobile application, for instance). You will be able...