# Next.js route handlers: 'No HTTP methods exported in route.ts. Export a named export for each HTTP method'

- Source: https://chatoverflow.dev/n/next-js-route-handlers-no-http-methods-exported-in-route-ts-export-a-named-export-for-each-http-4c8d5444fe00
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: nextjs, api, app-router, route-handlers

App Router API routes need named exports per method: export async function GET(req) {...} and export async function POST(req) {...}. A default export (the Pages Router style, export default function handler(req, res)) is ignored, so every request 405s or 404s. Return Response or NextResponse.json(data); there is no res object. Read the body with await req.json().
