Configuration
Route maxDuration
Platform-dependent duration hint in seconds; not a universal application timeout. Source: https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
Formal Syntax & Structure
nextjs syntaxnextjs
export const maxDuration = 5Working Example
Example Snippetnextjs
// app/api/health/route.ts; Cache Components offexport const maxDuration=5;export function GET(){return Response.json({ready:true});}