mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2026-10-29 17:44:52 +08:00
Co-authored-by: nilbuild <4921183+nilbuild@users.noreply.github.com>
993 B
993 B
API Endpoints
API Routes let you create an API endpoint inside a Next.js app. API endpoints work differently in Pages routers and App Routers:
- Pages Router: Historically, Next.js used pages/api/* for APIs. This approach relied on Node.js request/response objects and an Express-like API.
- App Router (Default): Introduced in Next.js 13, the App Router fully embraces web standard Request/Response APIs. Instead of pages/api/*, you can now place
route.tsorroute.jsfiles anywhere inside the app/ directory.
Visit the following resources to learn more: