Next.js 16 · Routing and files

Create an API route

A route.ts file exports a function per HTTP method.

export async function GET() {
  return Response.json({ ok: true });
}

Official Next.js 16 documentation

More routing and files commands

All routing and files commands · Next.js 16 cheatsheet

Was this page helpful?