Course lesson
Create a Dynamic API Route in Next.js App Router with the context Param
Dynamic API routes are similar to a dynamic page route. We can create a folder with the dynamic bracket syntax [customerId] that will map to the customer id found in the url.
- Duration
- 3 min
- Access
- Free
- Transcript
- Needs source
Dynamic API routes are similar to a dynamic page route. We can create a folder with the dynamic bracket syntax [customerId] that will map to the customer id found in the url.
The remaining syntax changes are utilizing NextResponse and exporting a GET function from the route.ts file.