[{"data":1,"prerenderedAt":4518},["ShallowReactive",2],{"navigation":3,"-docs-routing":377,"-docs-routing-surround":4514},[4,83,212,218,374],{"title":5,"path":6,"stem":7,"children":8,"icon":82},"","/docs","1.docs/1.index",[9,12,17,22,27,32,37,42,47,52,57,62,67,72,77],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-compass",{"title":13,"path":14,"stem":15,"icon":16},"Quick Start","/docs/quick-start","1.docs/2.quick-start","i-lucide-zap",{"title":18,"path":19,"stem":20,"icon":21},"Renderer","/docs/renderer","1.docs/4.renderer","ri:layout-masonry-line",{"title":23,"path":24,"stem":25,"icon":26},"Routing","/docs/routing","1.docs/5.routing","ri:direction-line",{"title":28,"path":29,"stem":30,"icon":31},"Assets","/docs/assets","1.docs/50.assets","ri:image-2-line",{"title":33,"path":34,"stem":35,"icon":36},"Configuration","/docs/configuration","1.docs/50.configuration","ri:settings-3-line",{"title":38,"path":39,"stem":40,"icon":41},"Database","/docs/database","1.docs/50.database","ri:database-2-line",{"title":43,"path":44,"stem":45,"icon":46},"Lifecycle","/docs/lifecycle","1.docs/50.lifecycle","i-lucide-layers",{"title":48,"path":49,"stem":50,"icon":51},"Plugins","/docs/plugins","1.docs/50.plugins","ri:plug-line",{"title":53,"path":54,"stem":55,"icon":56},"Tasks","/docs/tasks","1.docs/50.tasks","codicon:run-all",{"title":58,"path":59,"stem":60,"icon":61},"Server Entry","/docs/server-entry","1.docs/6.server-entry","ri:server-line",{"title":63,"path":64,"stem":65,"icon":66},"Cache","/docs/cache","1.docs/7.cache","ri:speed-line",{"title":68,"path":69,"stem":70,"icon":71},"KV Storage","/docs/storage","1.docs/8.storage","carbon:datastore",{"title":73,"path":74,"stem":75,"icon":76},"Migration Guide","/docs/migration","1.docs/99.migration","ri:arrow-right-up-line",{"title":78,"path":79,"stem":80,"icon":81},"Nightly Channel","/docs/nightly","1.docs/99.nightly","ri:moon-fill","i-lucide-book-open",{"title":84,"path":85,"stem":86,"children":87,"icon":89},"Deploy","/deploy","2.deploy/0.index",[88,90,111],{"title":84,"path":85,"stem":86,"icon":89},"ri:upload-cloud-2-line",{"title":91,"path":92,"stem":93,"children":94,"page":110},"Runtimes","/deploy/runtimes","2.deploy/10.runtimes",[95,100,105],{"title":96,"path":97,"stem":98,"icon":99},"Node.js","/deploy/runtimes/node","2.deploy/10.runtimes/1.node","akar-icons:node-fill",{"title":101,"path":102,"stem":103,"icon":104},"Bun","/deploy/runtimes/bun","2.deploy/10.runtimes/bun","simple-icons:bun",{"title":106,"path":107,"stem":108,"icon":109},"Deno","/deploy/runtimes/deno","2.deploy/10.runtimes/deno","simple-icons:deno",false,{"title":112,"path":113,"stem":114,"children":115,"page":110},"Providers","/deploy/providers","2.deploy/20.providers",[116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208],{"title":117,"path":118,"stem":119},"Alwaysdata","/deploy/providers/alwaysdata","2.deploy/20.providers/alwaysdata",{"title":121,"path":122,"stem":123},"AWS Lambda","/deploy/providers/aws","2.deploy/20.providers/aws",{"title":125,"path":126,"stem":127},"AWS Amplify","/deploy/providers/aws-amplify","2.deploy/20.providers/aws-amplify",{"title":129,"path":130,"stem":131},"Azure","/deploy/providers/azure","2.deploy/20.providers/azure",{"title":133,"path":134,"stem":135},"Cleavr","/deploy/providers/cleavr","2.deploy/20.providers/cleavr",{"title":137,"path":138,"stem":139},"Cloudflare","/deploy/providers/cloudflare","2.deploy/20.providers/cloudflare",{"title":141,"path":142,"stem":143},"Deno Deploy","/deploy/providers/deno-deploy","2.deploy/20.providers/deno-deploy",{"title":145,"path":146,"stem":147},"DigitalOcean","/deploy/providers/digitalocean","2.deploy/20.providers/digitalocean",{"title":149,"path":150,"stem":151},"Firebase","/deploy/providers/firebase","2.deploy/20.providers/firebase",{"title":153,"path":154,"stem":155},"Flightcontrol","/deploy/providers/flightcontrol","2.deploy/20.providers/flightcontrol",{"title":157,"path":158,"stem":159},"Genezio","/deploy/providers/genezio","2.deploy/20.providers/genezio",{"title":161,"path":162,"stem":163},"GitHub Pages","/deploy/providers/github-pages","2.deploy/20.providers/github-pages",{"title":165,"path":166,"stem":167},"GitLab Pages","/deploy/providers/gitlab-pages","2.deploy/20.providers/gitlab-pages",{"title":169,"path":170,"stem":171},"Heroku","/deploy/providers/heroku","2.deploy/20.providers/heroku",{"title":173,"path":174,"stem":175},"IIS","/deploy/providers/iis","2.deploy/20.providers/iis",{"title":177,"path":178,"stem":179},"Koyeb","/deploy/providers/koyeb","2.deploy/20.providers/koyeb",{"title":181,"path":182,"stem":183},"Netlify","/deploy/providers/netlify","2.deploy/20.providers/netlify",{"title":185,"path":186,"stem":187},"Platform.sh","/deploy/providers/platform-sh","2.deploy/20.providers/platform-sh",{"title":189,"path":190,"stem":191},"Render.com","/deploy/providers/render","2.deploy/20.providers/render",{"title":193,"path":194,"stem":195},"StormKit","/deploy/providers/stormkit","2.deploy/20.providers/stormkit",{"title":197,"path":198,"stem":199},"Vercel","/deploy/providers/vercel","2.deploy/20.providers/vercel",{"title":201,"path":202,"stem":203},"Zeabur","/deploy/providers/zeabur","2.deploy/20.providers/zeabur",{"title":205,"path":206,"stem":207},"Zephyr Cloud","/deploy/providers/zephyr","2.deploy/20.providers/zephyr",{"title":209,"path":210,"stem":211},"Zerops","/deploy/providers/zerops","2.deploy/20.providers/zerops",{"title":213,"path":214,"stem":215,"children":216,"icon":36},"Config","/config","3.config/0.index",[217],{"title":213,"path":214,"stem":215,"icon":36},{"title":219,"path":220,"stem":221,"children":222,"icon":224},"Examples","/examples","4.examples/0.index",[223,225,230,235,240,245,249,254,259,264,269,274,279,283,288,292,296,301,306,311,316,321,326,331,336,341,345,350,355,359,364,369],{"title":219,"path":220,"stem":221,"icon":224},"i-lucide-folder-code",{"title":226,"path":227,"stem":228,"icon":229},"API Routes","/examples/api-routes","4.examples/api-routes","i-lucide-route",{"title":231,"path":232,"stem":233,"icon":234},"Auto Imports","/examples/auto-imports","4.examples/auto-imports","i-lucide-import",{"title":236,"path":237,"stem":238,"icon":239},"Cached Handler","/examples/cached-handler","4.examples/cached-handler","i-lucide-clock",{"title":241,"path":242,"stem":243,"icon":244},"Custom Error Handler","/examples/custom-error-handler","4.examples/custom-error-handler","i-lucide-alert-circle",{"title":38,"path":246,"stem":247,"icon":248},"/examples/database","4.examples/database","i-lucide-database",{"title":250,"path":251,"stem":252,"icon":253},"Elysia","/examples/elysia","4.examples/elysia","i-skill-icons-elysia-dark",{"title":255,"path":256,"stem":257,"icon":258},"Express","/examples/express","4.examples/express","i-simple-icons-express",{"title":260,"path":261,"stem":262,"icon":263},"Fastify","/examples/fastify","4.examples/fastify","i-simple-icons-fastify",{"title":265,"path":266,"stem":267,"icon":268},"Hello World","/examples/hello-world","4.examples/hello-world","i-lucide-sparkles",{"title":270,"path":271,"stem":272,"icon":273},"Hono","/examples/hono","4.examples/hono","i-logos-hono",{"title":275,"path":276,"stem":277,"icon":278},"Import Alias","/examples/import-alias","4.examples/import-alias","i-lucide-at-sign",{"title":280,"path":281,"stem":282,"icon":46},"Middleware","/examples/middleware","4.examples/middleware",{"title":284,"path":285,"stem":286,"icon":287},"Mono JSX","/examples/mono-jsx","4.examples/mono-jsx","i-lucide-brackets",{"title":289,"path":290,"stem":291,"icon":287},"Nano JSX","/examples/nano-jsx","4.examples/nano-jsx",{"title":48,"path":293,"stem":294,"icon":295},"/examples/plugins","4.examples/plugins","i-lucide-plug",{"title":297,"path":298,"stem":299,"icon":300},"Custom Renderer","/examples/renderer","4.examples/renderer","i-lucide-code",{"title":302,"path":303,"stem":304,"icon":305},"Runtime Config","/examples/runtime-config","4.examples/runtime-config","i-lucide-settings",{"title":307,"path":308,"stem":309,"icon":310},"Server Fetch","/examples/server-fetch","4.examples/server-fetch","i-lucide-arrow-right-left",{"title":312,"path":313,"stem":314,"icon":315},"Shiki","/examples/shiki","4.examples/shiki","i-lucide-highlighter",{"title":317,"path":318,"stem":319,"icon":320},"Virtual Routes","/examples/virtual-routes","4.examples/virtual-routes","i-lucide-box",{"title":322,"path":323,"stem":324,"icon":325},"Vite Nitro Plugin","/examples/vite-nitro-plugin","4.examples/vite-nitro-plugin","i-logos-vitejs",{"title":327,"path":328,"stem":329,"icon":330},"Vite RSC","/examples/vite-rsc","4.examples/vite-rsc","i-logos-react",{"title":332,"path":333,"stem":334,"icon":335},"Vite SSR HTML","/examples/vite-ssr-html","4.examples/vite-ssr-html","i-logos-html-5",{"title":337,"path":338,"stem":339,"icon":340},"SSR with Preact","/examples/vite-ssr-preact","4.examples/vite-ssr-preact","i-logos-preact",{"title":342,"path":343,"stem":344,"icon":330},"SSR with React","/examples/vite-ssr-react","4.examples/vite-ssr-react",{"title":346,"path":347,"stem":348,"icon":349},"SSR with SolidJS","/examples/vite-ssr-solid","4.examples/vite-ssr-solid","i-logos-solidjs-icon",{"title":351,"path":352,"stem":353,"icon":354},"SSR with TanStack Router","/examples/vite-ssr-tsr-react","4.examples/vite-ssr-tsr-react","i-simple-icons-tanstack",{"title":356,"path":357,"stem":358,"icon":354},"SSR with TanStack Start","/examples/vite-ssr-tss-react","4.examples/vite-ssr-tss-react",{"title":360,"path":361,"stem":362,"icon":363},"SSR with Vue Router","/examples/vite-ssr-vue-router","4.examples/vite-ssr-vue-router","i-logos-vue",{"title":365,"path":366,"stem":367,"icon":368},"Vite + tRPC","/examples/vite-trpc","4.examples/vite-trpc","i-simple-icons-trpc",{"title":370,"path":371,"stem":372,"icon":373},"WebSocket","/examples/websocket","4.examples/websocket","i-lucide-radio",{"title":5,"path":375,"stem":376},"/","index",{"id":378,"title":23,"body":379,"description":4509,"extension":2097,"meta":4510,"navigation":4511,"path":24,"seo":4512,"stem":25,"__hash__":4513},"content/1.docs/5.routing.md",{"type":380,"value":381,"toc":4469,"icon":26},"minimark",[382,387,404,560,564,581,589,597,600,649,654,665,668,710,716,721,730,733,787,791,795,818,901,908,918,922,934,1020,1024,1034,1107,1112,1121,1125,1136,1166,1362,1366,1369,1375,1436,1440,1459,1462,1486,1499,1503,1510,1593,1597,1603,1609,1615,1740,1743,1859,1865,1870,1951,1954,2077,2079,2082,2087,2093,2129,2133,2136,2200,2211,2219,2223,2230,2236,2353,2360,2364,2367,2391,2394,2418,2451,2455,2458,2461,2464,2549,2553,2567,2641,2651,2655,2663,2674,2683,2687,2697,2707,2711,2714,2723,2738,2749,2756,2960,2964,2967,2974,3072,3076,3079,3155,3159,3179,3184,3259,3263,3270,3369,3373,3376,3512,3516,3519,3628,3632,3645,3785,3802,3806,3809,3875,3879,3882,3997,4001,4160,4164,4171,4250,4254,4257,4465],[383,384,386],"h2",{"id":385},"request-handler","Request handler",[388,389,390,391,395,396,403],"p",{},"Nitro request handler is a function accepting an ",[392,393,394],"code",{},"event"," object, which is a ",[397,398,402],"a",{"href":399,"rel":400},"https://h3.dev/guide/api/h3event#h3event-properties",[401],"nofollow","H3Event"," object.",[405,406,407,497],"code-group",{},[408,409,414],"pre",{"className":410,"code":411,"filename":412,"language":413,"meta":5,"style":5},"language-ts shiki shiki-themes github-light github-dark github-dark","import type { H3Event } from \"nitro\";\n\nexport default (event: H3Event) => {\n  return \"world\";\n}\n","Single function","ts",[392,415,416,442,449,480,491],{"__ignoreMap":5},[417,418,421,425,428,432,435,439],"span",{"class":419,"line":420},"line",1,[417,422,424],{"class":423},"so5gQ","import",[417,426,427],{"class":423}," type",[417,429,431],{"class":430},"slsVL"," { H3Event } ",[417,433,434],{"class":423},"from",[417,436,438],{"class":437},"sfrk1"," \"nitro\"",[417,440,441],{"class":430},";\n",[417,443,445],{"class":419,"line":444},2,[417,446,448],{"emptyLinePlaceholder":447},true,"\n",[417,450,452,455,458,461,464,467,471,474,477],{"class":419,"line":451},3,[417,453,454],{"class":423},"export",[417,456,457],{"class":423}," default",[417,459,460],{"class":430}," (",[417,462,394],{"class":463},"sQHwn",[417,465,466],{"class":423},":",[417,468,470],{"class":469},"shcOC"," H3Event",[417,472,473],{"class":430},") ",[417,475,476],{"class":423},"=>",[417,478,479],{"class":430}," {\n",[417,481,483,486,489],{"class":419,"line":482},4,[417,484,485],{"class":423},"  return",[417,487,488],{"class":437}," \"world\"",[417,490,441],{"class":430},[417,492,494],{"class":419,"line":493},5,[417,495,496],{"class":430},"}\n",[408,498,501],{"className":410,"code":499,"filename":500,"language":413,"meta":5,"style":5},"import { defineHandler } from \"nitro\";\n\n// For better type inference\nexport default defineHandler((event) => {\n  return \"world\";\n});\n","defineHandler",[392,502,503,516,520,526,546,554],{"__ignoreMap":5},[417,504,505,507,510,512,514],{"class":419,"line":420},[417,506,424],{"class":423},[417,508,509],{"class":430}," { defineHandler } ",[417,511,434],{"class":423},[417,513,438],{"class":437},[417,515,441],{"class":430},[417,517,518],{"class":419,"line":444},[417,519,448],{"emptyLinePlaceholder":447},[417,521,522],{"class":419,"line":451},[417,523,525],{"class":524},"sCsY4","// For better type inference\n",[417,527,528,530,532,535,538,540,542,544],{"class":419,"line":482},[417,529,454],{"class":423},[417,531,457],{"class":423},[417,533,534],{"class":469}," defineHandler",[417,536,537],{"class":430},"((",[417,539,394],{"class":463},[417,541,473],{"class":430},[417,543,476],{"class":423},[417,545,479],{"class":430},[417,547,548,550,552],{"class":419,"line":493},[417,549,485],{"class":423},[417,551,488],{"class":437},[417,553,441],{"class":430},[417,555,557],{"class":419,"line":556},6,[417,558,559],{"class":430},"});\n",[383,561,563],{"id":562},"filesystem-routing","Filesystem routing",[388,565,566,567,572,573,576,577,580],{},"Nitro supports file-based routing for your API routes (files are automatically mapped to ",[397,568,571],{"href":569,"rel":570},"https://h3.dev/guide/basics/routing",[401],"h3 routes","). Defining a route is as simple as creating a file inside the ",[392,574,575],{},"api/"," or ",[392,578,579],{},"routes/"," directory.",[388,582,583,584,588],{},"You can only define one handler per files and you can ",[397,585,587],{"href":586},"#specific-request-method","append the HTTP method"," to the filename to define a specific request method.",[408,590,595],{"className":591,"code":593,"language":594},[592],"language-text","routes/\n  api/\n    test.ts      \u003C-- /api/test\n  hello.get.ts   \u003C-- /hello (GET only)\n  hello.post.ts  \u003C-- /hello (POST only)\nvite.config.ts\n","text",[392,596,593],{"__ignoreMap":5},[388,598,599],{},"You can nest routes by creating subdirectories.",[408,601,605],{"className":602,"code":603,"language":604,"meta":5,"style":5},"language-txt shiki shiki-themes github-light github-dark github-dark","routes/\n  api/\n    [org]/\n      [repo]/\n        index.ts   \u003C-- /api/:org/:repo\n        issues.ts  \u003C-- /api/:org/:repo/issues\n      index.ts     \u003C-- /api/:org\npackage.json\n","txt",[392,606,607,612,617,622,627,632,637,643],{"__ignoreMap":5},[417,608,609],{"class":419,"line":420},[417,610,611],{},"routes/\n",[417,613,614],{"class":419,"line":444},[417,615,616],{},"  api/\n",[417,618,619],{"class":419,"line":451},[417,620,621],{},"    [org]/\n",[417,623,624],{"class":419,"line":482},[417,625,626],{},"      [repo]/\n",[417,628,629],{"class":419,"line":493},[417,630,631],{},"        index.ts   \u003C-- /api/:org/:repo\n",[417,633,634],{"class":419,"line":556},[417,635,636],{},"        issues.ts  \u003C-- /api/:org/:repo/issues\n",[417,638,640],{"class":419,"line":639},7,[417,641,642],{},"      index.ts     \u003C-- /api/:org\n",[417,644,646],{"class":419,"line":645},8,[417,647,648],{},"package.json\n",[650,651,653],"h4",{"id":652},"route-groups","Route Groups",[388,655,656,657,660,661,664],{},"In some cases, you may want to group a set of routes together in a way which doesn't affect file-based routing. For this purpose, you can put files in a folder which is wrapped in parentheses ",[392,658,659],{},"("," and ",[392,662,663],{},")",".",[388,666,667],{},"For example:",[408,669,671],{"className":602,"code":670,"language":604,"meta":5,"style":5},"routes/\n  api/\n    (admin)/\n      users.ts   \u003C-- /api/users\n      reports.ts \u003C-- /api/reports\n    (public)/\n      index.ts   \u003C-- /api\npackage.json\n",[392,672,673,677,681,686,691,696,701,706],{"__ignoreMap":5},[417,674,675],{"class":419,"line":420},[417,676,611],{},[417,678,679],{"class":419,"line":444},[417,680,616],{},[417,682,683],{"class":419,"line":451},[417,684,685],{},"    (admin)/\n",[417,687,688],{"class":419,"line":482},[417,689,690],{},"      users.ts   \u003C-- /api/users\n",[417,692,693],{"class":419,"line":493},[417,694,695],{},"      reports.ts \u003C-- /api/reports\n",[417,697,698],{"class":419,"line":556},[417,699,700],{},"    (public)/\n",[417,702,703],{"class":419,"line":639},[417,704,705],{},"      index.ts   \u003C-- /api\n",[417,707,708],{"class":419,"line":645},[417,709,648],{},[711,712,713],"note",{},[388,714,715],{}," The route groups are not part of the route definition and are only used for organization purposes.",[717,718,720],"h3",{"id":719},"static-routes","Static routes",[388,722,723,724,576,726,729],{},"First, create a file in ",[392,725,579],{},[392,727,728],{},"routes/api/"," directory. The filename will be the route path.",[388,731,732],{},"Then, export a fetch-compatible function:",[408,734,737],{"className":410,"code":735,"filename":736,"language":413,"meta":5,"style":5},"import { defineHandler } from \"nitro\";\n\nexport default defineHandler(() => {\n  return { hello: \"API\" };\n});\n","routes/api/test.ts",[392,738,739,751,755,770,783],{"__ignoreMap":5},[417,740,741,743,745,747,749],{"class":419,"line":420},[417,742,424],{"class":423},[417,744,509],{"class":430},[417,746,434],{"class":423},[417,748,438],{"class":437},[417,750,441],{"class":430},[417,752,753],{"class":419,"line":444},[417,754,448],{"emptyLinePlaceholder":447},[417,756,757,759,761,763,766,768],{"class":419,"line":451},[417,758,454],{"class":423},[417,760,457],{"class":423},[417,762,534],{"class":469},[417,764,765],{"class":430},"(() ",[417,767,476],{"class":423},[417,769,479],{"class":430},[417,771,772,774,777,780],{"class":419,"line":482},[417,773,485],{"class":423},[417,775,776],{"class":430}," { hello: ",[417,778,779],{"class":437},"\"API\"",[417,781,782],{"class":430}," };\n",[417,784,785],{"class":419,"line":493},[417,786,559],{"class":430},[717,788,790],{"id":789},"dynamic-routes","Dynamic routes",[650,792,794],{"id":793},"single-param","Single param",[388,796,797,798,801,802,805,806,809,810,817],{},"To define a route with params, use the ",[392,799,800],{},"[\u003Cparam>]"," syntax where ",[392,803,804],{},"\u003Cparam>"," is the name of the param. The param will be available in the ",[392,807,808],{},"event.context.params"," object or using the ",[397,811,814],{"href":812,"rel":813},"https://h3.dev/utils/request#getrouterparamevent-name-opts-decode",[401],[392,815,816],{},"getRouterParam"," utility.",[408,819,822],{"className":410,"code":820,"filename":821,"language":413,"meta":5,"style":5},"import { defineHandler } from \"nitro\";\n\nexport default defineHandler((event) => {\n  const { name } = event.context.params;\n\n  return `Hello ${name}!`;\n});\n","routes/hello/[name].ts",[392,823,824,836,840,858,879,883,897],{"__ignoreMap":5},[417,825,826,828,830,832,834],{"class":419,"line":420},[417,827,424],{"class":423},[417,829,509],{"class":430},[417,831,434],{"class":423},[417,833,438],{"class":437},[417,835,441],{"class":430},[417,837,838],{"class":419,"line":444},[417,839,448],{"emptyLinePlaceholder":447},[417,841,842,844,846,848,850,852,854,856],{"class":419,"line":451},[417,843,454],{"class":423},[417,845,457],{"class":423},[417,847,534],{"class":469},[417,849,537],{"class":430},[417,851,394],{"class":463},[417,853,473],{"class":430},[417,855,476],{"class":423},[417,857,479],{"class":430},[417,859,860,863,866,870,873,876],{"class":419,"line":482},[417,861,862],{"class":423},"  const",[417,864,865],{"class":430}," { ",[417,867,869],{"class":868},"suiK_","name",[417,871,872],{"class":430}," } ",[417,874,875],{"class":423},"=",[417,877,878],{"class":430}," event.context.params;\n",[417,880,881],{"class":419,"line":493},[417,882,448],{"emptyLinePlaceholder":447},[417,884,885,887,890,892,895],{"class":419,"line":556},[417,886,485],{"class":423},[417,888,889],{"class":437}," `Hello ${",[417,891,869],{"class":430},[417,893,894],{"class":437},"}!`",[417,896,441],{"class":430},[417,898,899],{"class":419,"line":639},[417,900,559],{"class":430},[388,902,903,904,907],{},"Call the route with the param ",[392,905,906],{},"/hello/nitro",", you will get:",[408,909,912],{"className":602,"code":910,"filename":911,"language":604,"meta":5,"style":5},"Hello nitro!\n","Response",[392,913,914],{"__ignoreMap":5},[417,915,916],{"class":419,"line":420},[417,917,910],{},[650,919,921],{"id":920},"multiple-params","Multiple params",[388,923,924,925,928,929,933],{},"You can define multiple params in a route using ",[392,926,927],{},"[\u003Cparam1>]/[\u003Cparam2>]"," syntax where each param is a folder. You ",[930,931,932],"strong",{},"cannot"," define multiple params in a single filename of folder.",[408,935,938],{"className":410,"code":936,"filename":937,"language":413,"meta":5,"style":5},"import { defineHandler } from \"nitro\";\n\nexport default defineHandler((event) => {\n  const { name, age } = event.context.params;\n\n  return `Hello ${name}! You are ${age} years old.`;\n});\n","routes/hello/[name]/[age].ts",[392,939,940,952,956,974,994,998,1016],{"__ignoreMap":5},[417,941,942,944,946,948,950],{"class":419,"line":420},[417,943,424],{"class":423},[417,945,509],{"class":430},[417,947,434],{"class":423},[417,949,438],{"class":437},[417,951,441],{"class":430},[417,953,954],{"class":419,"line":444},[417,955,448],{"emptyLinePlaceholder":447},[417,957,958,960,962,964,966,968,970,972],{"class":419,"line":451},[417,959,454],{"class":423},[417,961,457],{"class":423},[417,963,534],{"class":469},[417,965,537],{"class":430},[417,967,394],{"class":463},[417,969,473],{"class":430},[417,971,476],{"class":423},[417,973,479],{"class":430},[417,975,976,978,980,982,985,988,990,992],{"class":419,"line":482},[417,977,862],{"class":423},[417,979,865],{"class":430},[417,981,869],{"class":868},[417,983,984],{"class":430},", ",[417,986,987],{"class":868},"age",[417,989,872],{"class":430},[417,991,875],{"class":423},[417,993,878],{"class":430},[417,995,996],{"class":419,"line":493},[417,997,448],{"emptyLinePlaceholder":447},[417,999,1000,1002,1004,1006,1009,1011,1014],{"class":419,"line":556},[417,1001,485],{"class":423},[417,1003,889],{"class":437},[417,1005,869],{"class":430},[417,1007,1008],{"class":437},"}! You are ${",[417,1010,987],{"class":430},[417,1012,1013],{"class":437},"} years old.`",[417,1015,441],{"class":430},[417,1017,1018],{"class":419,"line":639},[417,1019,559],{"class":430},[650,1021,1023],{"id":1022},"catch-all-params","Catch-all params",[388,1025,1026,1027,1030,1031,1033],{},"You can capture all the remaining parts of a URL using ",[392,1028,1029],{},"[...\u003Cparam>]"," syntax. This will include the ",[392,1032,375],{}," in the param.",[408,1035,1037],{"className":410,"code":820,"filename":1036,"language":413,"meta":5,"style":5},"routes/hello/[...name].ts",[392,1038,1039,1051,1055,1073,1087,1091,1103],{"__ignoreMap":5},[417,1040,1041,1043,1045,1047,1049],{"class":419,"line":420},[417,1042,424],{"class":423},[417,1044,509],{"class":430},[417,1046,434],{"class":423},[417,1048,438],{"class":437},[417,1050,441],{"class":430},[417,1052,1053],{"class":419,"line":444},[417,1054,448],{"emptyLinePlaceholder":447},[417,1056,1057,1059,1061,1063,1065,1067,1069,1071],{"class":419,"line":451},[417,1058,454],{"class":423},[417,1060,457],{"class":423},[417,1062,534],{"class":469},[417,1064,537],{"class":430},[417,1066,394],{"class":463},[417,1068,473],{"class":430},[417,1070,476],{"class":423},[417,1072,479],{"class":430},[417,1074,1075,1077,1079,1081,1083,1085],{"class":419,"line":482},[417,1076,862],{"class":423},[417,1078,865],{"class":430},[417,1080,869],{"class":868},[417,1082,872],{"class":430},[417,1084,875],{"class":423},[417,1086,878],{"class":430},[417,1088,1089],{"class":419,"line":493},[417,1090,448],{"emptyLinePlaceholder":447},[417,1092,1093,1095,1097,1099,1101],{"class":419,"line":556},[417,1094,485],{"class":423},[417,1096,889],{"class":437},[417,1098,869],{"class":430},[417,1100,894],{"class":437},[417,1102,441],{"class":430},[417,1104,1105],{"class":419,"line":639},[417,1106,559],{"class":430},[388,1108,903,1109,907],{},[392,1110,1111],{},"/hello/nitro/is/hot",[408,1113,1115],{"className":602,"code":1114,"filename":911,"language":604,"meta":5,"style":5},"Hello nitro/is/hot!\n",[392,1116,1117],{"__ignoreMap":5},[417,1118,1119],{"class":419,"line":420},[417,1120,1114],{},[717,1122,1124],{"id":1123},"specific-request-method","Specific request method",[388,1126,1127,1128,1131,1132,1135],{},"You can append the HTTP method to the filename to force the route to be matched only for a specific HTTP request method, for example ",[392,1129,1130],{},"hello.get.ts"," will only match for ",[392,1133,1134],{},"GET"," requests. You can use any HTTP method you want.",[388,1137,1138,1139,984,1142,984,1145,984,1148,984,1151,984,1154,984,1157,984,1160,984,1163,664],{},"Supported methods: ",[392,1140,1141],{},"get",[392,1143,1144],{},"post",[392,1146,1147],{},"put",[392,1149,1150],{},"delete",[392,1152,1153],{},"patch",[392,1155,1156],{},"head",[392,1158,1159],{},"options",[392,1161,1162],{},"connect",[392,1164,1165],{},"trace",[405,1167,1168,1262],{},[408,1169,1173],{"className":1170,"code":1171,"filename":1134,"language":1172,"meta":5,"style":5},"language-js shiki shiki-themes github-light github-dark github-dark","// routes/users/[id].get.ts\nimport { defineHandler } from \"nitro\";\n\nexport default defineHandler(async (event) => {\n  const { id } = event.context.params;\n\n  // Do something with id\n\n  return `User profile!`;\n});\n","js",[392,1174,1175,1180,1192,1196,1219,1234,1238,1243,1247,1257],{"__ignoreMap":5},[417,1176,1177],{"class":419,"line":420},[417,1178,1179],{"class":524},"// routes/users/[id].get.ts\n",[417,1181,1182,1184,1186,1188,1190],{"class":419,"line":444},[417,1183,424],{"class":423},[417,1185,509],{"class":430},[417,1187,434],{"class":423},[417,1189,438],{"class":437},[417,1191,441],{"class":430},[417,1193,1194],{"class":419,"line":451},[417,1195,448],{"emptyLinePlaceholder":447},[417,1197,1198,1200,1202,1204,1206,1209,1211,1213,1215,1217],{"class":419,"line":482},[417,1199,454],{"class":423},[417,1201,457],{"class":423},[417,1203,534],{"class":469},[417,1205,659],{"class":430},[417,1207,1208],{"class":423},"async",[417,1210,460],{"class":430},[417,1212,394],{"class":463},[417,1214,473],{"class":430},[417,1216,476],{"class":423},[417,1218,479],{"class":430},[417,1220,1221,1223,1225,1228,1230,1232],{"class":419,"line":493},[417,1222,862],{"class":423},[417,1224,865],{"class":430},[417,1226,1227],{"class":868},"id",[417,1229,872],{"class":430},[417,1231,875],{"class":423},[417,1233,878],{"class":430},[417,1235,1236],{"class":419,"line":556},[417,1237,448],{"emptyLinePlaceholder":447},[417,1239,1240],{"class":419,"line":639},[417,1241,1242],{"class":524},"  // Do something with id\n",[417,1244,1245],{"class":419,"line":645},[417,1246,448],{"emptyLinePlaceholder":447},[417,1248,1250,1252,1255],{"class":419,"line":1249},9,[417,1251,485],{"class":423},[417,1253,1254],{"class":437}," `User profile!`",[417,1256,441],{"class":430},[417,1258,1260],{"class":419,"line":1259},10,[417,1261,559],{"class":430},[408,1263,1266],{"className":1170,"code":1264,"filename":1265,"language":1172,"meta":5,"style":5},"// routes/users.post.ts\nimport { defineHandler } from \"nitro\";\n\nexport default defineHandler(async (event) => {\n  const body = await event.req.json();\n\n  // Do something with body like saving it to a database\n\n  return { updated: true };\n});\n","POST",[392,1267,1268,1273,1285,1289,1311,1333,1337,1342,1346,1358],{"__ignoreMap":5},[417,1269,1270],{"class":419,"line":420},[417,1271,1272],{"class":524},"// routes/users.post.ts\n",[417,1274,1275,1277,1279,1281,1283],{"class":419,"line":444},[417,1276,424],{"class":423},[417,1278,509],{"class":430},[417,1280,434],{"class":423},[417,1282,438],{"class":437},[417,1284,441],{"class":430},[417,1286,1287],{"class":419,"line":451},[417,1288,448],{"emptyLinePlaceholder":447},[417,1290,1291,1293,1295,1297,1299,1301,1303,1305,1307,1309],{"class":419,"line":482},[417,1292,454],{"class":423},[417,1294,457],{"class":423},[417,1296,534],{"class":469},[417,1298,659],{"class":430},[417,1300,1208],{"class":423},[417,1302,460],{"class":430},[417,1304,394],{"class":463},[417,1306,473],{"class":430},[417,1308,476],{"class":423},[417,1310,479],{"class":430},[417,1312,1313,1315,1318,1321,1324,1327,1330],{"class":419,"line":493},[417,1314,862],{"class":423},[417,1316,1317],{"class":868}," body",[417,1319,1320],{"class":423}," =",[417,1322,1323],{"class":423}," await",[417,1325,1326],{"class":430}," event.req.",[417,1328,1329],{"class":469},"json",[417,1331,1332],{"class":430},"();\n",[417,1334,1335],{"class":419,"line":556},[417,1336,448],{"emptyLinePlaceholder":447},[417,1338,1339],{"class":419,"line":639},[417,1340,1341],{"class":524},"  // Do something with body like saving it to a database\n",[417,1343,1344],{"class":419,"line":645},[417,1345,448],{"emptyLinePlaceholder":447},[417,1347,1348,1350,1353,1356],{"class":419,"line":1249},[417,1349,485],{"class":423},[417,1351,1352],{"class":430}," { updated: ",[417,1354,1355],{"class":868},"true",[417,1357,782],{"class":430},[417,1359,1360],{"class":419,"line":1259},[417,1361,559],{"class":430},[717,1363,1365],{"id":1364},"catch-all-route","Catch-all route",[388,1367,1368],{},"You can create a special route that will match all routes that are not matched by any other route. This is useful for creating a default route.",[388,1370,1371,1372,664],{},"To create a catch-all route, create a file named ",[392,1373,1374],{},"[...].ts",[408,1376,1379],{"className":410,"code":1377,"filename":1378,"language":413,"meta":5,"style":5},"import { defineHandler } from \"nitro\";\n\nexport default defineHandler((event) => {\n  return `Hello ${event.url}!`;\n});\n","routes/[...].ts",[392,1380,1381,1393,1397,1415,1432],{"__ignoreMap":5},[417,1382,1383,1385,1387,1389,1391],{"class":419,"line":420},[417,1384,424],{"class":423},[417,1386,509],{"class":430},[417,1388,434],{"class":423},[417,1390,438],{"class":437},[417,1392,441],{"class":430},[417,1394,1395],{"class":419,"line":444},[417,1396,448],{"emptyLinePlaceholder":447},[417,1398,1399,1401,1403,1405,1407,1409,1411,1413],{"class":419,"line":451},[417,1400,454],{"class":423},[417,1402,457],{"class":423},[417,1404,534],{"class":469},[417,1406,537],{"class":430},[417,1408,394],{"class":463},[417,1410,473],{"class":430},[417,1412,476],{"class":423},[417,1414,479],{"class":430},[417,1416,1417,1419,1421,1423,1425,1428,1430],{"class":419,"line":482},[417,1418,485],{"class":423},[417,1420,889],{"class":437},[417,1422,394],{"class":430},[417,1424,664],{"class":437},[417,1426,1427],{"class":430},"url",[417,1429,894],{"class":437},[417,1431,441],{"class":430},[417,1433,1434],{"class":419,"line":493},[417,1435,559],{"class":430},[717,1437,1439],{"id":1438},"environment-specific-handlers","Environment specific handlers",[388,1441,1442,1443,984,1446,576,1449,1452,1453,576,1456,664],{},"You can specify for a route that will only be included in specific builds by adding a ",[392,1444,1445],{},".dev",[392,1447,1448],{},".prod",[392,1450,1451],{},".prerender"," suffix to the file name, for example: ",[392,1454,1455],{},"routes/test.get.dev.ts",[392,1457,1458],{},"routes/test.get.prod.ts",[388,1460,1461],{},"The suffix is placed after the method suffix (if any):",[408,1463,1465],{"className":602,"code":1464,"language":604,"meta":5,"style":5},"routes/\n  env/\n    index.dev.ts       \u003C-- /env (dev only)\n    index.get.prod.ts  \u003C-- /env (GET, prod only)\n",[392,1466,1467,1471,1476,1481],{"__ignoreMap":5},[417,1468,1469],{"class":419,"line":420},[417,1470,611],{},[417,1472,1473],{"class":419,"line":444},[417,1474,1475],{},"  env/\n",[417,1477,1478],{"class":419,"line":451},[417,1479,1480],{},"    index.dev.ts       \u003C-- /env (dev only)\n",[417,1482,1483],{"class":419,"line":482},[417,1484,1485],{},"    index.get.prod.ts  \u003C-- /env (GET, prod only)\n",[1487,1488,1489],"tip",{},[388,1490,1491,1492,1498],{},"\nYou can specify multiple environments or specify a preset name as environment using programmatic registration of routes via ",[397,1493,1495],{"href":1494},"#routes-config",[392,1496,1497],{},"routes"," config.",[717,1500,1502],{"id":1501},"ignoring-files","Ignoring files",[388,1504,1505,1506,1509],{},"You can use the ",[392,1507,1508],{},"ignore"," config option to exclude files from route scanning. It accepts an array of glob patterns relative to the server directory.",[408,1511,1514],{"className":410,"code":1512,"filename":1513,"language":413,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  ignore: [\n    \"routes/api/**/_*\",   // Ignore files starting with _ in api/\n    \"middleware/_*.ts\",    // Ignore middleware starting with _\n    \"routes/_*.ts\",       // Ignore root routes starting with _\n  ],\n});\n","nitro.config.ts",[392,1515,1516,1530,1534,1546,1551,1562,1573,1584,1589],{"__ignoreMap":5},[417,1517,1518,1520,1523,1525,1528],{"class":419,"line":420},[417,1519,424],{"class":423},[417,1521,1522],{"class":430}," { defineNitroConfig } ",[417,1524,434],{"class":423},[417,1526,1527],{"class":437}," \"nitro/config\"",[417,1529,441],{"class":430},[417,1531,1532],{"class":419,"line":444},[417,1533,448],{"emptyLinePlaceholder":447},[417,1535,1536,1538,1540,1543],{"class":419,"line":451},[417,1537,454],{"class":423},[417,1539,457],{"class":423},[417,1541,1542],{"class":469}," defineNitroConfig",[417,1544,1545],{"class":430},"({\n",[417,1547,1548],{"class":419,"line":482},[417,1549,1550],{"class":430},"  ignore: [\n",[417,1552,1553,1556,1559],{"class":419,"line":493},[417,1554,1555],{"class":437},"    \"routes/api/**/_*\"",[417,1557,1558],{"class":430},",   ",[417,1560,1561],{"class":524},"// Ignore files starting with _ in api/\n",[417,1563,1564,1567,1570],{"class":419,"line":556},[417,1565,1566],{"class":437},"    \"middleware/_*.ts\"",[417,1568,1569],{"class":430},",    ",[417,1571,1572],{"class":524},"// Ignore middleware starting with _\n",[417,1574,1575,1578,1581],{"class":419,"line":639},[417,1576,1577],{"class":437},"    \"routes/_*.ts\"",[417,1579,1580],{"class":430},",       ",[417,1582,1583],{"class":524},"// Ignore root routes starting with _\n",[417,1585,1586],{"class":419,"line":645},[417,1587,1588],{"class":430},"  ],\n",[417,1590,1591],{"class":419,"line":1249},[417,1592,559],{"class":430},[383,1594,1596],{"id":1595},"programmatic-route-handlers","Programmatic route handlers",[388,1598,1599,1600,1602],{},"In addition to filesystem routing, you can register route handlers programmatically using the ",[392,1601,1497],{}," config option.",[717,1604,1606,1608],{"id":1605},"routes-config",[392,1607,1497],{}," config",[388,1610,1611,1612,1614],{},"The ",[392,1613,1497],{}," option allows you to map route patterns to handlers:",[408,1616,1618],{"className":410,"code":1617,"filename":1513,"language":413,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  routes: {\n    \"/api/hello\": \"./server/routes/api/hello.ts\",\n    \"/api/custom\": {\n      handler: \"./server/routes/api/hello.ts\",\n      method: \"POST\",\n      lazy: true,\n    },\n    \"/virtual\": {\n      handler: \"#virtual-route\",\n    },\n  },\n});\n",[392,1619,1620,1632,1636,1646,1651,1665,1673,1682,1692,1701,1706,1714,1724,1729,1735],{"__ignoreMap":5},[417,1621,1622,1624,1626,1628,1630],{"class":419,"line":420},[417,1623,424],{"class":423},[417,1625,1522],{"class":430},[417,1627,434],{"class":423},[417,1629,1527],{"class":437},[417,1631,441],{"class":430},[417,1633,1634],{"class":419,"line":444},[417,1635,448],{"emptyLinePlaceholder":447},[417,1637,1638,1640,1642,1644],{"class":419,"line":451},[417,1639,454],{"class":423},[417,1641,457],{"class":423},[417,1643,1542],{"class":469},[417,1645,1545],{"class":430},[417,1647,1648],{"class":419,"line":482},[417,1649,1650],{"class":430},"  routes: {\n",[417,1652,1653,1656,1659,1662],{"class":419,"line":493},[417,1654,1655],{"class":437},"    \"/api/hello\"",[417,1657,1658],{"class":430},": ",[417,1660,1661],{"class":437},"\"./server/routes/api/hello.ts\"",[417,1663,1664],{"class":430},",\n",[417,1666,1667,1670],{"class":419,"line":556},[417,1668,1669],{"class":437},"    \"/api/custom\"",[417,1671,1672],{"class":430},": {\n",[417,1674,1675,1678,1680],{"class":419,"line":639},[417,1676,1677],{"class":430},"      handler: ",[417,1679,1661],{"class":437},[417,1681,1664],{"class":430},[417,1683,1684,1687,1690],{"class":419,"line":645},[417,1685,1686],{"class":430},"      method: ",[417,1688,1689],{"class":437},"\"POST\"",[417,1691,1664],{"class":430},[417,1693,1694,1697,1699],{"class":419,"line":1249},[417,1695,1696],{"class":430},"      lazy: ",[417,1698,1355],{"class":868},[417,1700,1664],{"class":430},[417,1702,1703],{"class":419,"line":1259},[417,1704,1705],{"class":430},"    },\n",[417,1707,1709,1712],{"class":419,"line":1708},11,[417,1710,1711],{"class":437},"    \"/virtual\"",[417,1713,1672],{"class":430},[417,1715,1717,1719,1722],{"class":419,"line":1716},12,[417,1718,1677],{"class":430},[417,1720,1721],{"class":437},"\"#virtual-route\"",[417,1723,1664],{"class":430},[417,1725,1727],{"class":419,"line":1726},13,[417,1728,1705],{"class":430},[417,1730,1732],{"class":419,"line":1731},14,[417,1733,1734],{"class":430},"  },\n",[417,1736,1738],{"class":419,"line":1737},15,[417,1739,559],{"class":430},[388,1741,1742],{},"Each route entry can be a simple string (handler path) or an object with the following options:",[1744,1745,1746,1762],"table",{},[1747,1748,1749],"thead",{},[1750,1751,1752,1756,1759],"tr",{},[1753,1754,1755],"th",{},"Option",[1753,1757,1758],{},"Type",[1753,1760,1761],{},"Description",[1763,1764,1765,1781,1800,1815,1834],"tbody",{},[1750,1766,1767,1773,1778],{},[1768,1769,1770],"td",{},[392,1771,1772],{},"handler",[1768,1774,1775],{},[392,1776,1777],{},"string",[1768,1779,1780],{},"Path to event handler file or virtual module ID",[1750,1782,1783,1788,1792],{},[1768,1784,1785],{},[392,1786,1787],{},"method",[1768,1789,1790],{},[392,1791,1777],{},[1768,1793,1794,1795,984,1797,1799],{},"HTTP method to match (",[392,1796,1141],{},[392,1798,1144],{},", etc.)",[1750,1801,1802,1807,1812],{},[1768,1803,1804],{},[392,1805,1806],{},"lazy",[1768,1808,1809],{},[392,1810,1811],{},"boolean",[1768,1813,1814],{},"Use lazy loading to import handler",[1750,1816,1817,1822,1827],{},[1768,1818,1819],{},[392,1820,1821],{},"format",[1768,1823,1824],{},[392,1825,1826],{},"\"web\" | \"node\"",[1768,1828,1829,1830,1833],{},"Handler type. ",[392,1831,1832],{},"\"node\""," handlers are converted to web-compatible",[1750,1835,1836,1841,1846],{},[1768,1837,1838],{},[392,1839,1840],{},"env",[1768,1842,1843],{},[392,1844,1845],{},"string | string[]",[1768,1847,1848,1849,984,1852,984,1855,1858],{},"Environments to include this handler (",[392,1850,1851],{},"\"dev\"",[392,1853,1854],{},"\"prod\"",[392,1856,1857],{},"\"prerender\"",", or a preset name)",[717,1860,1862,1608],{"id":1861},"handlers-config",[392,1863,1864],{},"handlers",[388,1866,1611,1867,1869],{},[392,1868,1864],{}," array is useful for registering middleware with control over route matching:",[408,1871,1873],{"className":410,"code":1872,"filename":1513,"language":413,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  handlers: [\n    {\n      route: \"/api/**\",\n      handler: \"./server/middleware/api-auth.ts\",\n      middleware: true,\n    },\n  ],\n});\n",[392,1874,1875,1887,1891,1901,1906,1911,1921,1930,1939,1943,1947],{"__ignoreMap":5},[417,1876,1877,1879,1881,1883,1885],{"class":419,"line":420},[417,1878,424],{"class":423},[417,1880,1522],{"class":430},[417,1882,434],{"class":423},[417,1884,1527],{"class":437},[417,1886,441],{"class":430},[417,1888,1889],{"class":419,"line":444},[417,1890,448],{"emptyLinePlaceholder":447},[417,1892,1893,1895,1897,1899],{"class":419,"line":451},[417,1894,454],{"class":423},[417,1896,457],{"class":423},[417,1898,1542],{"class":469},[417,1900,1545],{"class":430},[417,1902,1903],{"class":419,"line":482},[417,1904,1905],{"class":430},"  handlers: [\n",[417,1907,1908],{"class":419,"line":493},[417,1909,1910],{"class":430},"    {\n",[417,1912,1913,1916,1919],{"class":419,"line":556},[417,1914,1915],{"class":430},"      route: ",[417,1917,1918],{"class":437},"\"/api/**\"",[417,1920,1664],{"class":430},[417,1922,1923,1925,1928],{"class":419,"line":639},[417,1924,1677],{"class":430},[417,1926,1927],{"class":437},"\"./server/middleware/api-auth.ts\"",[417,1929,1664],{"class":430},[417,1931,1932,1935,1937],{"class":419,"line":645},[417,1933,1934],{"class":430},"      middleware: ",[417,1936,1355],{"class":868},[417,1938,1664],{"class":430},[417,1940,1941],{"class":419,"line":1249},[417,1942,1705],{"class":430},[417,1944,1945],{"class":419,"line":1259},[417,1946,1588],{"class":430},[417,1948,1949],{"class":419,"line":1708},[417,1950,559],{"class":430},[388,1952,1953],{},"Each handler entry supports the following options:",[1744,1955,1956,1966],{},[1747,1957,1958],{},[1750,1959,1960,1962,1964],{},[1753,1961,1755],{},[1753,1963,1758],{},[1753,1965,1761],{},[1763,1967,1968,1991,2003,2019,2033,2045,2059],{},[1750,1969,1970,1975,1979],{},[1768,1971,1972],{},[392,1973,1974],{},"route",[1768,1976,1977],{},[392,1978,1777],{},[1768,1980,1981,1982,984,1985,984,1988,663],{},"HTTP pathname pattern (e.g., ",[392,1983,1984],{},"/test",[392,1986,1987],{},"/api/:id",[392,1989,1990],{},"/blog/**",[1750,1992,1993,1997,2001],{},[1768,1994,1995],{},[392,1996,1772],{},[1768,1998,1999],{},[392,2000,1777],{},[1768,2002,1780],{},[1750,2004,2005,2009,2013],{},[1768,2006,2007],{},[392,2008,1787],{},[1768,2010,2011],{},[392,2012,1777],{},[1768,2014,1794,2015,984,2017,1799],{},[392,2016,1141],{},[392,2018,1144],{},[1750,2020,2021,2026,2030],{},[1768,2022,2023],{},[392,2024,2025],{},"middleware",[1768,2027,2028],{},[392,2029,1811],{},[1768,2031,2032],{},"Run handler as middleware before route handlers",[1750,2034,2035,2039,2043],{},[1768,2036,2037],{},[392,2038,1806],{},[1768,2040,2041],{},[392,2042,1811],{},[1768,2044,1814],{},[1750,2046,2047,2051,2055],{},[1768,2048,2049],{},[392,2050,1821],{},[1768,2052,2053],{},[392,2054,1826],{},[1768,2056,1829,2057,1833],{},[392,2058,1832],{},[1750,2060,2061,2065,2069],{},[1768,2062,2063],{},[392,2064,1840],{},[1768,2066,2067],{},[392,2068,1845],{},[1768,2070,1848,2071,984,2073,984,2075,1858],{},[392,2072,1851],{},[392,2074,1854],{},[392,2076,1857],{},[383,2078,280],{"id":2025},[388,2080,2081],{},"Nitro route middleware can hook into the request lifecycle.",[1487,2083,2084],{},[388,2085,2086],{},"A middleware can modify the request before it is processed, not after.",[388,2088,2089,2090,580],{},"Middleware are auto-registered within the ",[392,2091,2092],{},"middleware/",[408,2094,2098],{"className":2095,"code":2096,"language":2097,"meta":5,"style":5},"language-md shiki shiki-themes github-light github-dark github-dark","middleware/\n  auth.ts\n  logger.ts\n  ...\nroutes/\n  hello.ts\n","md",[392,2099,2100,2105,2110,2115,2120,2124],{"__ignoreMap":5},[417,2101,2102],{"class":419,"line":420},[417,2103,2104],{"class":430},"middleware/\n",[417,2106,2107],{"class":419,"line":444},[417,2108,2109],{"class":430},"  auth.ts\n",[417,2111,2112],{"class":419,"line":451},[417,2113,2114],{"class":430},"  logger.ts\n",[417,2116,2117],{"class":419,"line":482},[417,2118,2119],{"class":430},"  ...\n",[417,2121,2122],{"class":419,"line":493},[417,2123,611],{"class":430},[417,2125,2126],{"class":419,"line":556},[417,2127,2128],{"class":430},"  hello.ts\n",[717,2130,2132],{"id":2131},"simple-middleware","Simple middleware",[388,2134,2135],{},"Middleware are defined exactly like route handlers with the only exception that they should not return anything.\nReturning from middleware behaves like returning from a request - the value will be returned as a response and further code will not be ran.",[408,2137,2140],{"className":410,"code":2138,"filename":2139,"language":413,"meta":5,"style":5},"import { defineHandler } from \"nitro\";\n\nexport default defineHandler((event) => {\n  // Extends or modify the event\n  event.context.user = { name: \"Nitro\" };\n});\n","middleware/auth.ts",[392,2141,2142,2154,2158,2176,2181,2196],{"__ignoreMap":5},[417,2143,2144,2146,2148,2150,2152],{"class":419,"line":420},[417,2145,424],{"class":423},[417,2147,509],{"class":430},[417,2149,434],{"class":423},[417,2151,438],{"class":437},[417,2153,441],{"class":430},[417,2155,2156],{"class":419,"line":444},[417,2157,448],{"emptyLinePlaceholder":447},[417,2159,2160,2162,2164,2166,2168,2170,2172,2174],{"class":419,"line":451},[417,2161,454],{"class":423},[417,2163,457],{"class":423},[417,2165,534],{"class":469},[417,2167,537],{"class":430},[417,2169,394],{"class":463},[417,2171,473],{"class":430},[417,2173,476],{"class":423},[417,2175,479],{"class":430},[417,2177,2178],{"class":419,"line":482},[417,2179,2180],{"class":524},"  // Extends or modify the event\n",[417,2182,2183,2186,2188,2191,2194],{"class":419,"line":493},[417,2184,2185],{"class":430},"  event.context.user ",[417,2187,875],{"class":423},[417,2189,2190],{"class":430}," { name: ",[417,2192,2193],{"class":437},"\"Nitro\"",[417,2195,782],{"class":430},[417,2197,2198],{"class":419,"line":556},[417,2199,559],{"class":430},[388,2201,2202,2203,2205,2206,664],{},"Middleware in ",[392,2204,2092],{}," directory are automatically registered for all routes. If you want to register a middleware for a specific route, see ",[397,2207,2210],{"href":2208,"rel":2209},"https://h3.dev/guide/basics/handler#object-syntax",[401],"Object Syntax Event Handler",[711,2212,2213],{},[388,2214,2215,2216],{},"Returning anything from a middleware will close the request and should be avoided! Any returned value from middleware will be the response and further code will not be executed however ",[930,2217,2218],{},"this is not recommended to do!",[717,2220,2222],{"id":2221},"route-meta","Route Meta",[388,2224,2225,2226,2229],{},"You can define route handler meta at build-time using ",[392,2227,2228],{},"defineRouteMeta"," macro in the event handler files.",[2231,2232,2233],"important",{},[388,2234,2235],{},"\nThis feature is currently experimental.",[408,2237,2239],{"className":410,"code":2238,"filename":736,"language":413,"meta":5,"style":5},"import { defineRouteMeta } from \"nitro\";\nimport { defineHandler } from \"nitro\";\n\ndefineRouteMeta({\n  openAPI: {\n    tags: [\"test\"],\n    description: \"Test route description\",\n    parameters: [{ in: \"query\", name: \"test\", required: true }],\n  },\n});\n\nexport default defineHandler(() => \"OK\");\n",[392,2240,2241,2254,2266,2270,2276,2281,2292,2302,2323,2327,2331,2335],{"__ignoreMap":5},[417,2242,2243,2245,2248,2250,2252],{"class":419,"line":420},[417,2244,424],{"class":423},[417,2246,2247],{"class":430}," { defineRouteMeta } ",[417,2249,434],{"class":423},[417,2251,438],{"class":437},[417,2253,441],{"class":430},[417,2255,2256,2258,2260,2262,2264],{"class":419,"line":444},[417,2257,424],{"class":423},[417,2259,509],{"class":430},[417,2261,434],{"class":423},[417,2263,438],{"class":437},[417,2265,441],{"class":430},[417,2267,2268],{"class":419,"line":451},[417,2269,448],{"emptyLinePlaceholder":447},[417,2271,2272,2274],{"class":419,"line":482},[417,2273,2228],{"class":469},[417,2275,1545],{"class":430},[417,2277,2278],{"class":419,"line":493},[417,2279,2280],{"class":430},"  openAPI: {\n",[417,2282,2283,2286,2289],{"class":419,"line":556},[417,2284,2285],{"class":430},"    tags: [",[417,2287,2288],{"class":437},"\"test\"",[417,2290,2291],{"class":430},"],\n",[417,2293,2294,2297,2300],{"class":419,"line":639},[417,2295,2296],{"class":430},"    description: ",[417,2298,2299],{"class":437},"\"Test route description\"",[417,2301,1664],{"class":430},[417,2303,2304,2307,2310,2313,2315,2318,2320],{"class":419,"line":645},[417,2305,2306],{"class":430},"    parameters: [{ in: ",[417,2308,2309],{"class":437},"\"query\"",[417,2311,2312],{"class":430},", name: ",[417,2314,2288],{"class":437},[417,2316,2317],{"class":430},", required: ",[417,2319,1355],{"class":868},[417,2321,2322],{"class":430}," }],\n",[417,2324,2325],{"class":419,"line":1249},[417,2326,1734],{"class":430},[417,2328,2329],{"class":419,"line":1259},[417,2330,559],{"class":430},[417,2332,2333],{"class":419,"line":1708},[417,2334,448],{"emptyLinePlaceholder":447},[417,2336,2337,2339,2341,2343,2345,2347,2350],{"class":419,"line":1716},[417,2338,454],{"class":423},[417,2340,457],{"class":423},[417,2342,534],{"class":469},[417,2344,765],{"class":430},[417,2346,476],{"class":423},[417,2348,2349],{"class":437}," \"OK\"",[417,2351,2352],{"class":430},");\n",[2354,2355,2357],"read-more",{"to":2356},"https://swagger.io/specification/v3/",[388,2358,2359],{},"This feature is currently usable to specify OpenAPI meta. See swagger specification for available OpenAPI options.",[717,2361,2363],{"id":2362},"execution-order","Execution order",[388,2365,2366],{},"Middleware are executed in directory listing order.",[408,2368,2370],{"className":2095,"code":2369,"language":2097,"meta":5,"style":5},"middleware/\n  auth.ts \u003C-- First\n  logger.ts \u003C-- Second\n  ... \u003C-- Third\n",[392,2371,2372,2376,2381,2386],{"__ignoreMap":5},[417,2373,2374],{"class":419,"line":420},[417,2375,2104],{"class":430},[417,2377,2378],{"class":419,"line":444},[417,2379,2380],{"class":430},"  auth.ts \u003C-- First\n",[417,2382,2383],{"class":419,"line":451},[417,2384,2385],{"class":430},"  logger.ts \u003C-- Second\n",[417,2387,2388],{"class":419,"line":482},[417,2389,2390],{"class":430},"  ... \u003C-- Third\n",[388,2392,2393],{},"Prefix middleware with a number to control their execution order.",[408,2395,2397],{"className":2095,"code":2396,"language":2097,"meta":5,"style":5},"middleware/\n  1.logger.ts \u003C-- First\n  2.auth.ts \u003C-- Second\n  3.... \u003C-- Third\n",[392,2398,2399,2403,2408,2413],{"__ignoreMap":5},[417,2400,2401],{"class":419,"line":420},[417,2402,2104],{"class":430},[417,2404,2405],{"class":419,"line":444},[417,2406,2407],{"class":430},"  1.logger.ts \u003C-- First\n",[417,2409,2410],{"class":419,"line":451},[417,2411,2412],{"class":430},"  2.auth.ts \u003C-- Second\n",[417,2414,2415],{"class":419,"line":482},[417,2416,2417],{"class":430},"  3.... \u003C-- Third\n",[711,2419,2420],{},[388,2421,2422,2423,984,2426,660,2429,2432,2433,2435,2436,2438,2439,2442,2443,2446,2447,2450],{},"Remember that file names are sorted as strings, thus for example if you have 3 files ",[392,2424,2425],{},"1.filename.ts",[392,2427,2428],{},"2.filename.ts",[392,2430,2431],{},"10.filename.ts",", the ",[392,2434,2431],{}," will come after the ",[392,2437,2425],{},". To avoid this, prefix ",[392,2440,2441],{},"1-9"," with a ",[392,2444,2445],{},"0"," like ",[392,2448,2449],{},"01",", if you have more than 10 middleware in the same directory.",[717,2452,2454],{"id":2453},"request-filtering","Request filtering",[388,2456,2457],{},"Middleware are executed on every request.",[388,2459,2460],{},"Apply custom logic to scope them to specific conditions.",[388,2462,2463],{},"For example, you can use the URL to apply a middleware to a specific route:",[408,2465,2467],{"className":410,"code":2466,"filename":2139,"language":413,"meta":5,"style":5},"import { defineHandler } from \"nitro\";\n\nexport default defineHandler((event) => {\n  // Will only execute for /auth route\n  if (event.url.pathname.startsWith('/auth')) {\n    event.context.user = { name: \"Nitro\" };\n  }\n});\n",[392,2468,2469,2481,2485,2503,2508,2527,2540,2545],{"__ignoreMap":5},[417,2470,2471,2473,2475,2477,2479],{"class":419,"line":420},[417,2472,424],{"class":423},[417,2474,509],{"class":430},[417,2476,434],{"class":423},[417,2478,438],{"class":437},[417,2480,441],{"class":430},[417,2482,2483],{"class":419,"line":444},[417,2484,448],{"emptyLinePlaceholder":447},[417,2486,2487,2489,2491,2493,2495,2497,2499,2501],{"class":419,"line":451},[417,2488,454],{"class":423},[417,2490,457],{"class":423},[417,2492,534],{"class":469},[417,2494,537],{"class":430},[417,2496,394],{"class":463},[417,2498,473],{"class":430},[417,2500,476],{"class":423},[417,2502,479],{"class":430},[417,2504,2505],{"class":419,"line":482},[417,2506,2507],{"class":524},"  // Will only execute for /auth route\n",[417,2509,2510,2513,2516,2519,2521,2524],{"class":419,"line":493},[417,2511,2512],{"class":423},"  if",[417,2514,2515],{"class":430}," (event.url.pathname.",[417,2517,2518],{"class":469},"startsWith",[417,2520,659],{"class":430},[417,2522,2523],{"class":437},"'/auth'",[417,2525,2526],{"class":430},")) {\n",[417,2528,2529,2532,2534,2536,2538],{"class":419,"line":556},[417,2530,2531],{"class":430},"    event.context.user ",[417,2533,875],{"class":423},[417,2535,2190],{"class":430},[417,2537,2193],{"class":437},[417,2539,782],{"class":430},[417,2541,2542],{"class":419,"line":639},[417,2543,2544],{"class":430},"  }\n",[417,2546,2547],{"class":419,"line":645},[417,2548,559],{"class":430},[717,2550,2552],{"id":2551},"route-scoped-middleware","Route-scoped middleware",[388,2554,2555,2556,2561,2562,2564,2565,466],{},"You can register middleware for specific route patterns using the ",[397,2557,2559],{"href":2558},"#handlers-config",[392,2560,1864],{}," config with the ",[392,2563,2025],{}," option and a specific ",[392,2566,1974],{},[408,2568,2569],{"className":410,"code":1872,"filename":1513,"language":413,"meta":5,"style":5},[392,2570,2571,2583,2587,2597,2601,2605,2613,2621,2629,2633,2637],{"__ignoreMap":5},[417,2572,2573,2575,2577,2579,2581],{"class":419,"line":420},[417,2574,424],{"class":423},[417,2576,1522],{"class":430},[417,2578,434],{"class":423},[417,2580,1527],{"class":437},[417,2582,441],{"class":430},[417,2584,2585],{"class":419,"line":444},[417,2586,448],{"emptyLinePlaceholder":447},[417,2588,2589,2591,2593,2595],{"class":419,"line":451},[417,2590,454],{"class":423},[417,2592,457],{"class":423},[417,2594,1542],{"class":469},[417,2596,1545],{"class":430},[417,2598,2599],{"class":419,"line":482},[417,2600,1905],{"class":430},[417,2602,2603],{"class":419,"line":493},[417,2604,1910],{"class":430},[417,2606,2607,2609,2611],{"class":419,"line":556},[417,2608,1915],{"class":430},[417,2610,1918],{"class":437},[417,2612,1664],{"class":430},[417,2614,2615,2617,2619],{"class":419,"line":639},[417,2616,1677],{"class":430},[417,2618,1927],{"class":437},[417,2620,1664],{"class":430},[417,2622,2623,2625,2627],{"class":419,"line":645},[417,2624,1934],{"class":430},[417,2626,1355],{"class":868},[417,2628,1664],{"class":430},[417,2630,2631],{"class":419,"line":1249},[417,2632,1705],{"class":430},[417,2634,2635],{"class":419,"line":1259},[417,2636,1588],{"class":430},[417,2638,2639],{"class":419,"line":1708},[417,2640,559],{"class":430},[388,2642,2643,2644,2646,2647,2650],{},"Unlike global middleware (registered in the ",[392,2645,2092],{}," directory which match ",[392,2648,2649],{},"/**","), route-scoped middleware only run for requests matching the specified pattern.",[383,2652,2654],{"id":2653},"error-handling","Error handling",[388,2656,1505,2657,2662],{},[397,2658,2661],{"href":2659,"rel":2660},"https://h3.dev/guide/basics/error",[401],"utilities available in H3"," to handle errors in both routes and middlewares.",[388,2664,2665,2666,2669,2670,2673],{},"The way errors are sent back to the client depends on the environment. In development, requests with an ",[392,2667,2668],{},"Accept"," header of ",[392,2671,2672],{},"text/html"," (such as browsers) will receive a HTML error page. In production, errors are always sent in JSON.",[388,2675,2676,2677,576,2679,2682],{},"This behaviour can be overridden by some request properties (e.g.: ",[392,2678,2668],{},[392,2680,2681],{},"User-Agent"," headers).",[383,2684,2686],{"id":2685},"code-splitting","Code splitting",[388,2688,2689,2690,2693,2694,664],{},"Nitro creates a separate chunk for each route handler. Chunks load on-demand when first requested, so ",[392,2691,2692],{},"/api/users"," doesn't load code for ",[392,2695,2696],{},"/api/posts",[388,2698,2699,2700,2706],{},"See ",[397,2701,2703],{"href":2702},"/config#inlinedynamicimports",[392,2704,2705],{},"inlineDynamicImports"," to bundle everything into a single file.",[383,2708,2710],{"id":2709},"route-rules","Route rules",[388,2712,2713],{},"Nitro allows you to add logic at the top-level for each route of your configuration. It can be used for redirecting, proxying, caching, authentication, and adding headers to routes.",[388,2715,2716,2717,2722],{},"It is a map from route pattern (following ",[397,2718,2721],{"href":2719,"rel":2720},"https://github.com/h3js/rou3",[401],"rou3",") to route options.",[388,2724,2725,2726,2729,2730,2733,2734,2737],{},"When ",[392,2727,2728],{},"cache"," option is set, handlers matching pattern will be automatically wrapped with ",[392,2731,2732],{},"defineCachedEventHandler",". See the ",[397,2735,2736],{"href":64},"cache guide"," to learn more about this function.",[711,2739,2740],{},[388,2741,2742,2745,2746],{},[392,2743,2744],{},"swr: true|number"," is shortcut for ",[392,2747,2748],{},"cache: { swr: true, maxAge: number }",[388,2750,2751,2752,2755],{},"You can set route rules in the ",[392,2753,2754],{},"nitro.routeRules"," options.",[408,2757,2759],{"className":410,"code":2758,"filename":1513,"language":413,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  routeRules: {\n    '/blog/**': { swr: true },\n    '/blog/**': { swr: 600 },\n    '/blog/**': { static: true },\n    '/blog/**': { cache: { /* cache options*/ } },\n    '/assets/**': { headers: { 'cache-control': 's-maxage=0' } },\n    '/api/v1/**': { cors: true, headers: { 'access-control-allow-methods': 'GET' } },\n    '/old-page': { redirect: '/new-page' },\n    '/old-page/**': { redirect: '/new-page/**' },\n    '/proxy/example': { proxy: 'https://example.com' },\n    '/proxy/**': { proxy: '/api/**' },\n    '/admin/**': { basicAuth: { username: 'admin', password: 'supersecret' } },\n  }\n});\n",[392,2760,2761,2773,2777,2787,2792,2805,2816,2827,2840,2858,2881,2894,2906,2919,2931,2950,2955],{"__ignoreMap":5},[417,2762,2763,2765,2767,2769,2771],{"class":419,"line":420},[417,2764,424],{"class":423},[417,2766,1522],{"class":430},[417,2768,434],{"class":423},[417,2770,1527],{"class":437},[417,2772,441],{"class":430},[417,2774,2775],{"class":419,"line":444},[417,2776,448],{"emptyLinePlaceholder":447},[417,2778,2779,2781,2783,2785],{"class":419,"line":451},[417,2780,454],{"class":423},[417,2782,457],{"class":423},[417,2784,1542],{"class":469},[417,2786,1545],{"class":430},[417,2788,2789],{"class":419,"line":482},[417,2790,2791],{"class":430},"  routeRules: {\n",[417,2793,2794,2797,2800,2802],{"class":419,"line":493},[417,2795,2796],{"class":437},"    '/blog/**'",[417,2798,2799],{"class":430},": { swr: ",[417,2801,1355],{"class":868},[417,2803,2804],{"class":430}," },\n",[417,2806,2807,2809,2811,2814],{"class":419,"line":556},[417,2808,2796],{"class":437},[417,2810,2799],{"class":430},[417,2812,2813],{"class":868},"600",[417,2815,2804],{"class":430},[417,2817,2818,2820,2823,2825],{"class":419,"line":639},[417,2819,2796],{"class":437},[417,2821,2822],{"class":430},": { static: ",[417,2824,1355],{"class":868},[417,2826,2804],{"class":430},[417,2828,2829,2831,2834,2837],{"class":419,"line":645},[417,2830,2796],{"class":437},[417,2832,2833],{"class":430},": { cache: { ",[417,2835,2836],{"class":524},"/* cache options*/",[417,2838,2839],{"class":430}," } },\n",[417,2841,2842,2845,2848,2851,2853,2856],{"class":419,"line":1249},[417,2843,2844],{"class":437},"    '/assets/**'",[417,2846,2847],{"class":430},": { headers: { ",[417,2849,2850],{"class":437},"'cache-control'",[417,2852,1658],{"class":430},[417,2854,2855],{"class":437},"'s-maxage=0'",[417,2857,2839],{"class":430},[417,2859,2860,2863,2866,2868,2871,2874,2876,2879],{"class":419,"line":1259},[417,2861,2862],{"class":437},"    '/api/v1/**'",[417,2864,2865],{"class":430},": { cors: ",[417,2867,1355],{"class":868},[417,2869,2870],{"class":430},", headers: { ",[417,2872,2873],{"class":437},"'access-control-allow-methods'",[417,2875,1658],{"class":430},[417,2877,2878],{"class":437},"'GET'",[417,2880,2839],{"class":430},[417,2882,2883,2886,2889,2892],{"class":419,"line":1708},[417,2884,2885],{"class":437},"    '/old-page'",[417,2887,2888],{"class":430},": { redirect: ",[417,2890,2891],{"class":437},"'/new-page'",[417,2893,2804],{"class":430},[417,2895,2896,2899,2901,2904],{"class":419,"line":1716},[417,2897,2898],{"class":437},"    '/old-page/**'",[417,2900,2888],{"class":430},[417,2902,2903],{"class":437},"'/new-page/**'",[417,2905,2804],{"class":430},[417,2907,2908,2911,2914,2917],{"class":419,"line":1726},[417,2909,2910],{"class":437},"    '/proxy/example'",[417,2912,2913],{"class":430},": { proxy: ",[417,2915,2916],{"class":437},"'https://example.com'",[417,2918,2804],{"class":430},[417,2920,2921,2924,2926,2929],{"class":419,"line":1731},[417,2922,2923],{"class":437},"    '/proxy/**'",[417,2925,2913],{"class":430},[417,2927,2928],{"class":437},"'/api/**'",[417,2930,2804],{"class":430},[417,2932,2933,2936,2939,2942,2945,2948],{"class":419,"line":1737},[417,2934,2935],{"class":437},"    '/admin/**'",[417,2937,2938],{"class":430},": { basicAuth: { username: ",[417,2940,2941],{"class":437},"'admin'",[417,2943,2944],{"class":430},", password: ",[417,2946,2947],{"class":437},"'supersecret'",[417,2949,2839],{"class":430},[417,2951,2953],{"class":419,"line":2952},16,[417,2954,2544],{"class":430},[417,2956,2958],{"class":419,"line":2957},17,[417,2959,559],{"class":430},[717,2961,2963],{"id":2962},"rule-merging-and-overrides","Rule merging and overrides",[388,2965,2966],{},"Route rules are matched from least specific to most specific. When multiple rules match a request, their options are merged, with more specific rules taking precedence.",[388,2968,2969,2970,2973],{},"You can use ",[392,2971,2972],{},"false"," to disable a rule that was set by a more general pattern:",[408,2975,2977],{"className":410,"code":2976,"filename":1513,"language":413,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  routeRules: {\n    '/api/cached/**': { swr: true },\n    '/api/cached/no-cache': { cache: false, swr: false },\n    '/admin/**': { basicAuth: { username: 'admin', password: 'secret' } },\n    '/admin/public/**': { basicAuth: false },\n  }\n});\n",[392,2978,2979,2991,2995,3005,3009,3020,3037,3052,3064,3068],{"__ignoreMap":5},[417,2980,2981,2983,2985,2987,2989],{"class":419,"line":420},[417,2982,424],{"class":423},[417,2984,1522],{"class":430},[417,2986,434],{"class":423},[417,2988,1527],{"class":437},[417,2990,441],{"class":430},[417,2992,2993],{"class":419,"line":444},[417,2994,448],{"emptyLinePlaceholder":447},[417,2996,2997,2999,3001,3003],{"class":419,"line":451},[417,2998,454],{"class":423},[417,3000,457],{"class":423},[417,3002,1542],{"class":469},[417,3004,1545],{"class":430},[417,3006,3007],{"class":419,"line":482},[417,3008,2791],{"class":430},[417,3010,3011,3014,3016,3018],{"class":419,"line":493},[417,3012,3013],{"class":437},"    '/api/cached/**'",[417,3015,2799],{"class":430},[417,3017,1355],{"class":868},[417,3019,2804],{"class":430},[417,3021,3022,3025,3028,3030,3033,3035],{"class":419,"line":556},[417,3023,3024],{"class":437},"    '/api/cached/no-cache'",[417,3026,3027],{"class":430},": { cache: ",[417,3029,2972],{"class":868},[417,3031,3032],{"class":430},", swr: ",[417,3034,2972],{"class":868},[417,3036,2804],{"class":430},[417,3038,3039,3041,3043,3045,3047,3050],{"class":419,"line":639},[417,3040,2935],{"class":437},[417,3042,2938],{"class":430},[417,3044,2941],{"class":437},[417,3046,2944],{"class":430},[417,3048,3049],{"class":437},"'secret'",[417,3051,2839],{"class":430},[417,3053,3054,3057,3060,3062],{"class":419,"line":645},[417,3055,3056],{"class":437},"    '/admin/public/**'",[417,3058,3059],{"class":430},": { basicAuth: ",[417,3061,2972],{"class":868},[417,3063,2804],{"class":430},[417,3065,3066],{"class":419,"line":1249},[417,3067,2544],{"class":430},[417,3069,3070],{"class":419,"line":1259},[417,3071,559],{"class":430},[717,3073,3075],{"id":3074},"headers","Headers",[388,3077,3078],{},"Set custom response headers for matching routes:",[408,3080,3082],{"className":410,"code":3081,"filename":1513,"language":413,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  routeRules: {\n    '/api/**': { headers: { 'cache-control': 's-maxage=60' } },\n    '**': { headers: { 'x-powered-by': 'Nitro' } },\n  }\n});\n",[392,3083,3084,3096,3100,3110,3114,3130,3147,3151],{"__ignoreMap":5},[417,3085,3086,3088,3090,3092,3094],{"class":419,"line":420},[417,3087,424],{"class":423},[417,3089,1522],{"class":430},[417,3091,434],{"class":423},[417,3093,1527],{"class":437},[417,3095,441],{"class":430},[417,3097,3098],{"class":419,"line":444},[417,3099,448],{"emptyLinePlaceholder":447},[417,3101,3102,3104,3106,3108],{"class":419,"line":451},[417,3103,454],{"class":423},[417,3105,457],{"class":423},[417,3107,1542],{"class":469},[417,3109,1545],{"class":430},[417,3111,3112],{"class":419,"line":482},[417,3113,2791],{"class":430},[417,3115,3116,3119,3121,3123,3125,3128],{"class":419,"line":493},[417,3117,3118],{"class":437},"    '/api/**'",[417,3120,2847],{"class":430},[417,3122,2850],{"class":437},[417,3124,1658],{"class":430},[417,3126,3127],{"class":437},"'s-maxage=60'",[417,3129,2839],{"class":430},[417,3131,3132,3135,3137,3140,3142,3145],{"class":419,"line":556},[417,3133,3134],{"class":437},"    '**'",[417,3136,2847],{"class":430},[417,3138,3139],{"class":437},"'x-powered-by'",[417,3141,1658],{"class":430},[417,3143,3144],{"class":437},"'Nitro'",[417,3146,2839],{"class":430},[417,3148,3149],{"class":419,"line":639},[417,3150,2544],{"class":430},[417,3152,3153],{"class":419,"line":645},[417,3154,559],{"class":430},[717,3156,3158],{"id":3157},"cors","CORS",[388,3160,3161,3162,3165,3166,984,3169,984,3172,3175,3176,664],{},"Enable CORS headers with the ",[392,3163,3164],{},"cors: true"," shortcut. This sets ",[392,3167,3168],{},"access-control-allow-origin: *",[392,3170,3171],{},"access-control-allow-methods: *",[392,3173,3174],{},"access-control-allow-headers: *",", and ",[392,3177,3178],{},"access-control-max-age: 0",[388,3180,3181,3182,466],{},"You can override individual CORS headers using ",[392,3183,3074],{},[408,3185,3187],{"className":410,"code":3186,"filename":1513,"language":413,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  routeRules: {\n    '/api/v1/**': {\n      cors: true,\n      headers: { 'access-control-allow-methods': 'GET' },\n    },\n  }\n});\n",[392,3188,3189,3201,3205,3215,3219,3225,3234,3247,3251,3255],{"__ignoreMap":5},[417,3190,3191,3193,3195,3197,3199],{"class":419,"line":420},[417,3192,424],{"class":423},[417,3194,1522],{"class":430},[417,3196,434],{"class":423},[417,3198,1527],{"class":437},[417,3200,441],{"class":430},[417,3202,3203],{"class":419,"line":444},[417,3204,448],{"emptyLinePlaceholder":447},[417,3206,3207,3209,3211,3213],{"class":419,"line":451},[417,3208,454],{"class":423},[417,3210,457],{"class":423},[417,3212,1542],{"class":469},[417,3214,1545],{"class":430},[417,3216,3217],{"class":419,"line":482},[417,3218,2791],{"class":430},[417,3220,3221,3223],{"class":419,"line":493},[417,3222,2862],{"class":437},[417,3224,1672],{"class":430},[417,3226,3227,3230,3232],{"class":419,"line":556},[417,3228,3229],{"class":430},"      cors: ",[417,3231,1355],{"class":868},[417,3233,1664],{"class":430},[417,3235,3236,3239,3241,3243,3245],{"class":419,"line":639},[417,3237,3238],{"class":430},"      headers: { ",[417,3240,2873],{"class":437},[417,3242,1658],{"class":430},[417,3244,2878],{"class":437},[417,3246,2804],{"class":430},[417,3248,3249],{"class":419,"line":645},[417,3250,1705],{"class":430},[417,3252,3253],{"class":419,"line":1249},[417,3254,2544],{"class":430},[417,3256,3257],{"class":419,"line":1259},[417,3258,559],{"class":430},[717,3260,3262],{"id":3261},"redirect","Redirect",[388,3264,3265,3266,3269],{},"Redirect matching routes to another URL. Use a string for a simple redirect (defaults to ",[392,3267,3268],{},"307"," status), or an object for more control:",[408,3271,3273],{"className":410,"code":3272,"filename":1513,"language":413,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  routeRules: {\n    // Simple redirect (307 status)\n    '/old-page': { redirect: '/new-page' },\n    // Redirect with custom status\n    '/legacy': { redirect: { to: 'https://example.com/', status: 308 } },\n    // Wildcard redirect — preserves the path after the pattern\n    '/old-blog/**': { redirect: 'https://blog.example.com/**' },\n  }\n});\n",[392,3274,3275,3287,3291,3301,3305,3310,3320,3325,3344,3349,3361,3365],{"__ignoreMap":5},[417,3276,3277,3279,3281,3283,3285],{"class":419,"line":420},[417,3278,424],{"class":423},[417,3280,1522],{"class":430},[417,3282,434],{"class":423},[417,3284,1527],{"class":437},[417,3286,441],{"class":430},[417,3288,3289],{"class":419,"line":444},[417,3290,448],{"emptyLinePlaceholder":447},[417,3292,3293,3295,3297,3299],{"class":419,"line":451},[417,3294,454],{"class":423},[417,3296,457],{"class":423},[417,3298,1542],{"class":469},[417,3300,1545],{"class":430},[417,3302,3303],{"class":419,"line":482},[417,3304,2791],{"class":430},[417,3306,3307],{"class":419,"line":493},[417,3308,3309],{"class":524},"    // Simple redirect (307 status)\n",[417,3311,3312,3314,3316,3318],{"class":419,"line":556},[417,3313,2885],{"class":437},[417,3315,2888],{"class":430},[417,3317,2891],{"class":437},[417,3319,2804],{"class":430},[417,3321,3322],{"class":419,"line":639},[417,3323,3324],{"class":524},"    // Redirect with custom status\n",[417,3326,3327,3330,3333,3336,3339,3342],{"class":419,"line":645},[417,3328,3329],{"class":437},"    '/legacy'",[417,3331,3332],{"class":430},": { redirect: { to: ",[417,3334,3335],{"class":437},"'https://example.com/'",[417,3337,3338],{"class":430},", status: ",[417,3340,3341],{"class":868},"308",[417,3343,2839],{"class":430},[417,3345,3346],{"class":419,"line":1249},[417,3347,3348],{"class":524},"    // Wildcard redirect — preserves the path after the pattern\n",[417,3350,3351,3354,3356,3359],{"class":419,"line":1259},[417,3352,3353],{"class":437},"    '/old-blog/**'",[417,3355,2888],{"class":430},[417,3357,3358],{"class":437},"'https://blog.example.com/**'",[417,3360,2804],{"class":430},[417,3362,3363],{"class":419,"line":1708},[417,3364,2544],{"class":430},[417,3366,3367],{"class":419,"line":1716},[417,3368,559],{"class":430},[717,3370,3372],{"id":3371},"proxy","Proxy",[388,3374,3375],{},"Proxy requests to another URL. Supports both internal and external targets:",[408,3377,3379],{"className":410,"code":3378,"filename":1513,"language":413,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  routeRules: {\n    // Proxy to exact URL\n    '/api/proxy/example': { proxy: 'https://example.com' },\n    // Proxy to internal route\n    '/api/proxy/**': { proxy: '/api/echo' },\n    // Wildcard proxy — preserves the path after the pattern\n    '/cdn/**': { proxy: 'https://cdn.jsdelivr.net/**' },\n    // Proxy with options\n    '/external/**': {\n      proxy: {\n        to: 'https://api.example.com/**',\n        // Additional H3 proxy options...\n      },\n    },\n  }\n});\n",[392,3380,3381,3393,3397,3407,3411,3416,3427,3432,3444,3449,3461,3466,3473,3478,3488,3493,3498,3502,3507],{"__ignoreMap":5},[417,3382,3383,3385,3387,3389,3391],{"class":419,"line":420},[417,3384,424],{"class":423},[417,3386,1522],{"class":430},[417,3388,434],{"class":423},[417,3390,1527],{"class":437},[417,3392,441],{"class":430},[417,3394,3395],{"class":419,"line":444},[417,3396,448],{"emptyLinePlaceholder":447},[417,3398,3399,3401,3403,3405],{"class":419,"line":451},[417,3400,454],{"class":423},[417,3402,457],{"class":423},[417,3404,1542],{"class":469},[417,3406,1545],{"class":430},[417,3408,3409],{"class":419,"line":482},[417,3410,2791],{"class":430},[417,3412,3413],{"class":419,"line":493},[417,3414,3415],{"class":524},"    // Proxy to exact URL\n",[417,3417,3418,3421,3423,3425],{"class":419,"line":556},[417,3419,3420],{"class":437},"    '/api/proxy/example'",[417,3422,2913],{"class":430},[417,3424,2916],{"class":437},[417,3426,2804],{"class":430},[417,3428,3429],{"class":419,"line":639},[417,3430,3431],{"class":524},"    // Proxy to internal route\n",[417,3433,3434,3437,3439,3442],{"class":419,"line":645},[417,3435,3436],{"class":437},"    '/api/proxy/**'",[417,3438,2913],{"class":430},[417,3440,3441],{"class":437},"'/api/echo'",[417,3443,2804],{"class":430},[417,3445,3446],{"class":419,"line":1249},[417,3447,3448],{"class":524},"    // Wildcard proxy — preserves the path after the pattern\n",[417,3450,3451,3454,3456,3459],{"class":419,"line":1259},[417,3452,3453],{"class":437},"    '/cdn/**'",[417,3455,2913],{"class":430},[417,3457,3458],{"class":437},"'https://cdn.jsdelivr.net/**'",[417,3460,2804],{"class":430},[417,3462,3463],{"class":419,"line":1708},[417,3464,3465],{"class":524},"    // Proxy with options\n",[417,3467,3468,3471],{"class":419,"line":1716},[417,3469,3470],{"class":437},"    '/external/**'",[417,3472,1672],{"class":430},[417,3474,3475],{"class":419,"line":1726},[417,3476,3477],{"class":430},"      proxy: {\n",[417,3479,3480,3483,3486],{"class":419,"line":1731},[417,3481,3482],{"class":430},"        to: ",[417,3484,3485],{"class":437},"'https://api.example.com/**'",[417,3487,1664],{"class":430},[417,3489,3490],{"class":419,"line":1737},[417,3491,3492],{"class":524},"        // Additional H3 proxy options...\n",[417,3494,3495],{"class":419,"line":2952},[417,3496,3497],{"class":430},"      },\n",[417,3499,3500],{"class":419,"line":2957},[417,3501,1705],{"class":430},[417,3503,3505],{"class":419,"line":3504},18,[417,3506,2544],{"class":430},[417,3508,3510],{"class":419,"line":3509},19,[417,3511,559],{"class":430},[717,3513,3515],{"id":3514},"basic-auth","Basic auth",[388,3517,3518],{},"Protect routes with HTTP Basic Authentication:",[408,3520,3522],{"className":410,"code":3521,"filename":1513,"language":413,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  routeRules: {\n    '/admin/**': {\n      basicAuth: {\n        username: 'admin',\n        password: 'supersecret',\n        realm: 'Admin Area',  // Optional, shown in the browser prompt\n      },\n    },\n    // Disable basic auth for a sub-path\n    '/admin/public/**': { basicAuth: false },\n  }\n});\n",[392,3523,3524,3536,3540,3550,3554,3560,3565,3574,3583,3597,3601,3605,3610,3620,3624],{"__ignoreMap":5},[417,3525,3526,3528,3530,3532,3534],{"class":419,"line":420},[417,3527,424],{"class":423},[417,3529,1522],{"class":430},[417,3531,434],{"class":423},[417,3533,1527],{"class":437},[417,3535,441],{"class":430},[417,3537,3538],{"class":419,"line":444},[417,3539,448],{"emptyLinePlaceholder":447},[417,3541,3542,3544,3546,3548],{"class":419,"line":451},[417,3543,454],{"class":423},[417,3545,457],{"class":423},[417,3547,1542],{"class":469},[417,3549,1545],{"class":430},[417,3551,3552],{"class":419,"line":482},[417,3553,2791],{"class":430},[417,3555,3556,3558],{"class":419,"line":493},[417,3557,2935],{"class":437},[417,3559,1672],{"class":430},[417,3561,3562],{"class":419,"line":556},[417,3563,3564],{"class":430},"      basicAuth: {\n",[417,3566,3567,3570,3572],{"class":419,"line":639},[417,3568,3569],{"class":430},"        username: ",[417,3571,2941],{"class":437},[417,3573,1664],{"class":430},[417,3575,3576,3579,3581],{"class":419,"line":645},[417,3577,3578],{"class":430},"        password: ",[417,3580,2947],{"class":437},[417,3582,1664],{"class":430},[417,3584,3585,3588,3591,3594],{"class":419,"line":1249},[417,3586,3587],{"class":430},"        realm: ",[417,3589,3590],{"class":437},"'Admin Area'",[417,3592,3593],{"class":430},",  ",[417,3595,3596],{"class":524},"// Optional, shown in the browser prompt\n",[417,3598,3599],{"class":419,"line":1259},[417,3600,3497],{"class":430},[417,3602,3603],{"class":419,"line":1708},[417,3604,1705],{"class":430},[417,3606,3607],{"class":419,"line":1716},[417,3608,3609],{"class":524},"    // Disable basic auth for a sub-path\n",[417,3611,3612,3614,3616,3618],{"class":419,"line":1726},[417,3613,3056],{"class":437},[417,3615,3059],{"class":430},[417,3617,2972],{"class":868},[417,3619,2804],{"class":430},[417,3621,3622],{"class":419,"line":1731},[417,3623,2544],{"class":430},[417,3625,3626],{"class":419,"line":1737},[417,3627,559],{"class":430},[717,3629,3631],{"id":3630},"caching-swr-static","Caching (SWR / Static)",[388,3633,3634,3635,984,3637,3640,3641,3644],{},"Control caching behavior with ",[392,3636,2728],{},[392,3638,3639],{},"swr",", or ",[392,3642,3643],{},"static"," options:",[408,3646,3648],{"className":410,"code":3647,"filename":1513,"language":413,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  routeRules: {\n    // Enable stale-while-revalidate caching\n    '/blog/**': { swr: true },\n    // SWR with maxAge in seconds\n    '/blog/posts/**': { swr: 600 },\n    // Full cache options\n    '/api/data/**': {\n      cache: {\n        maxAge: 60,\n        swr: true,\n        // ...other cache options\n      },\n    },\n    // Disable caching\n    '/api/realtime/**': { cache: false },\n  }\n});\n",[392,3649,3650,3662,3666,3676,3680,3685,3695,3700,3711,3716,3723,3728,3738,3747,3752,3756,3760,3765,3776,3780],{"__ignoreMap":5},[417,3651,3652,3654,3656,3658,3660],{"class":419,"line":420},[417,3653,424],{"class":423},[417,3655,1522],{"class":430},[417,3657,434],{"class":423},[417,3659,1527],{"class":437},[417,3661,441],{"class":430},[417,3663,3664],{"class":419,"line":444},[417,3665,448],{"emptyLinePlaceholder":447},[417,3667,3668,3670,3672,3674],{"class":419,"line":451},[417,3669,454],{"class":423},[417,3671,457],{"class":423},[417,3673,1542],{"class":469},[417,3675,1545],{"class":430},[417,3677,3678],{"class":419,"line":482},[417,3679,2791],{"class":430},[417,3681,3682],{"class":419,"line":493},[417,3683,3684],{"class":524},"    // Enable stale-while-revalidate caching\n",[417,3686,3687,3689,3691,3693],{"class":419,"line":556},[417,3688,2796],{"class":437},[417,3690,2799],{"class":430},[417,3692,1355],{"class":868},[417,3694,2804],{"class":430},[417,3696,3697],{"class":419,"line":639},[417,3698,3699],{"class":524},"    // SWR with maxAge in seconds\n",[417,3701,3702,3705,3707,3709],{"class":419,"line":645},[417,3703,3704],{"class":437},"    '/blog/posts/**'",[417,3706,2799],{"class":430},[417,3708,2813],{"class":868},[417,3710,2804],{"class":430},[417,3712,3713],{"class":419,"line":1249},[417,3714,3715],{"class":524},"    // Full cache options\n",[417,3717,3718,3721],{"class":419,"line":1259},[417,3719,3720],{"class":437},"    '/api/data/**'",[417,3722,1672],{"class":430},[417,3724,3725],{"class":419,"line":1708},[417,3726,3727],{"class":430},"      cache: {\n",[417,3729,3730,3733,3736],{"class":419,"line":1716},[417,3731,3732],{"class":430},"        maxAge: ",[417,3734,3735],{"class":868},"60",[417,3737,1664],{"class":430},[417,3739,3740,3743,3745],{"class":419,"line":1726},[417,3741,3742],{"class":430},"        swr: ",[417,3744,1355],{"class":868},[417,3746,1664],{"class":430},[417,3748,3749],{"class":419,"line":1731},[417,3750,3751],{"class":524},"        // ...other cache options\n",[417,3753,3754],{"class":419,"line":1737},[417,3755,3497],{"class":430},[417,3757,3758],{"class":419,"line":2952},[417,3759,1705],{"class":430},[417,3761,3762],{"class":419,"line":2957},[417,3763,3764],{"class":524},"    // Disable caching\n",[417,3766,3767,3770,3772,3774],{"class":419,"line":3504},[417,3768,3769],{"class":437},"    '/api/realtime/**'",[417,3771,3027],{"class":430},[417,3773,2972],{"class":868},[417,3775,2804],{"class":430},[417,3777,3778],{"class":419,"line":3509},[417,3779,2544],{"class":430},[417,3781,3783],{"class":419,"line":3782},20,[417,3784,559],{"class":430},[1487,3786,3787],{},[388,3788,3789,3792,3793,660,3796,3792,3799,664],{},[392,3790,3791],{},"swr: true"," is a shortcut for ",[392,3794,3795],{},"cache: { swr: true }",[392,3797,3798],{},"swr: \u003Cnumber>",[392,3800,3801],{},"cache: { swr: true, maxAge: \u003Cnumber> }",[717,3803,3805],{"id":3804},"prerender","Prerender",[388,3807,3808],{},"Mark routes for prerendering at build time:",[408,3810,3812],{"className":410,"code":3811,"filename":1513,"language":413,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  routeRules: {\n    '/about': { prerender: true },\n    '/dynamic/**': { prerender: false },\n  }\n});\n",[392,3813,3814,3826,3830,3840,3844,3856,3867,3871],{"__ignoreMap":5},[417,3815,3816,3818,3820,3822,3824],{"class":419,"line":420},[417,3817,424],{"class":423},[417,3819,1522],{"class":430},[417,3821,434],{"class":423},[417,3823,1527],{"class":437},[417,3825,441],{"class":430},[417,3827,3828],{"class":419,"line":444},[417,3829,448],{"emptyLinePlaceholder":447},[417,3831,3832,3834,3836,3838],{"class":419,"line":451},[417,3833,454],{"class":423},[417,3835,457],{"class":423},[417,3837,1542],{"class":469},[417,3839,1545],{"class":430},[417,3841,3842],{"class":419,"line":482},[417,3843,2791],{"class":430},[417,3845,3846,3849,3852,3854],{"class":419,"line":493},[417,3847,3848],{"class":437},"    '/about'",[417,3850,3851],{"class":430},": { prerender: ",[417,3853,1355],{"class":868},[417,3855,2804],{"class":430},[417,3857,3858,3861,3863,3865],{"class":419,"line":556},[417,3859,3860],{"class":437},"    '/dynamic/**'",[417,3862,3851],{"class":430},[417,3864,2972],{"class":868},[417,3866,2804],{"class":430},[417,3868,3869],{"class":419,"line":639},[417,3870,2544],{"class":430},[417,3872,3873],{"class":419,"line":645},[417,3874,559],{"class":430},[717,3876,3878],{"id":3877},"isr-vercel","ISR (Vercel)",[388,3880,3881],{},"Configure Incremental Static Regeneration for Vercel deployments:",[408,3883,3885],{"className":410,"code":3884,"filename":1513,"language":413,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  routeRules: {\n    '/isr/**': { isr: true },\n    '/isr-ttl/**': { isr: 60 },\n    '/isr-custom/**': {\n      isr: {\n        expiration: 60,\n        allowQuery: ['q'],\n        group: 1,\n      },\n    },\n  }\n});\n",[392,3886,3887,3899,3903,3913,3917,3929,3940,3947,3952,3961,3971,3981,3985,3989,3993],{"__ignoreMap":5},[417,3888,3889,3891,3893,3895,3897],{"class":419,"line":420},[417,3890,424],{"class":423},[417,3892,1522],{"class":430},[417,3894,434],{"class":423},[417,3896,1527],{"class":437},[417,3898,441],{"class":430},[417,3900,3901],{"class":419,"line":444},[417,3902,448],{"emptyLinePlaceholder":447},[417,3904,3905,3907,3909,3911],{"class":419,"line":451},[417,3906,454],{"class":423},[417,3908,457],{"class":423},[417,3910,1542],{"class":469},[417,3912,1545],{"class":430},[417,3914,3915],{"class":419,"line":482},[417,3916,2791],{"class":430},[417,3918,3919,3922,3925,3927],{"class":419,"line":493},[417,3920,3921],{"class":437},"    '/isr/**'",[417,3923,3924],{"class":430},": { isr: ",[417,3926,1355],{"class":868},[417,3928,2804],{"class":430},[417,3930,3931,3934,3936,3938],{"class":419,"line":556},[417,3932,3933],{"class":437},"    '/isr-ttl/**'",[417,3935,3924],{"class":430},[417,3937,3735],{"class":868},[417,3939,2804],{"class":430},[417,3941,3942,3945],{"class":419,"line":639},[417,3943,3944],{"class":437},"    '/isr-custom/**'",[417,3946,1672],{"class":430},[417,3948,3949],{"class":419,"line":645},[417,3950,3951],{"class":430},"      isr: {\n",[417,3953,3954,3957,3959],{"class":419,"line":1249},[417,3955,3956],{"class":430},"        expiration: ",[417,3958,3735],{"class":868},[417,3960,1664],{"class":430},[417,3962,3963,3966,3969],{"class":419,"line":1259},[417,3964,3965],{"class":430},"        allowQuery: [",[417,3967,3968],{"class":437},"'q'",[417,3970,2291],{"class":430},[417,3972,3973,3976,3979],{"class":419,"line":1708},[417,3974,3975],{"class":430},"        group: ",[417,3977,3978],{"class":868},"1",[417,3980,1664],{"class":430},[417,3982,3983],{"class":419,"line":1716},[417,3984,3497],{"class":430},[417,3986,3987],{"class":419,"line":1726},[417,3988,1705],{"class":430},[417,3990,3991],{"class":419,"line":1731},[417,3992,2544],{"class":430},[417,3994,3995],{"class":419,"line":1737},[417,3996,559],{"class":430},[717,3998,4000],{"id":3999},"route-rules-reference","Route rules reference",[1744,4002,4003,4013],{},[1747,4004,4005],{},[1750,4006,4007,4009,4011],{},[1753,4008,1755],{},[1753,4010,1758],{},[1753,4012,1761],{},[1763,4014,4015,4029,4045,4059,4072,4088,4104,4117,4132,4145],{},[1750,4016,4017,4021,4026],{},[1768,4018,4019],{},[392,4020,3074],{},[1768,4022,4023],{},[392,4024,4025],{},"Record\u003Cstring, string>",[1768,4027,4028],{},"Custom response headers",[1750,4030,4031,4035,4040],{},[1768,4032,4033],{},[392,4034,3261],{},[1768,4036,4037],{},[392,4038,4039],{},"string | { to: string, status?: number }",[1768,4041,4042,4043,663],{},"Redirect to another URL (default status: ",[392,4044,3268],{},[1750,4046,4047,4051,4056],{},[1768,4048,4049],{},[392,4050,3371],{},[1768,4052,4053],{},[392,4054,4055],{},"string | { to: string, ...proxyOptions }",[1768,4057,4058],{},"Proxy requests to another URL",[1750,4060,4061,4065,4069],{},[1768,4062,4063],{},[392,4064,3157],{},[1768,4066,4067],{},[392,4068,1811],{},[1768,4070,4071],{},"Enable permissive CORS headers",[1750,4073,4074,4078,4083],{},[1768,4075,4076],{},[392,4077,2728],{},[1768,4079,4080],{},[392,4081,4082],{},"object | false",[1768,4084,4085,4086,663],{},"Cache options (see ",[397,4087,2736],{"href":64},[1750,4089,4090,4094,4099],{},[1768,4091,4092],{},[392,4093,3639],{},[1768,4095,4096],{},[392,4097,4098],{},"boolean | number",[1768,4100,4101,4102],{},"Shortcut for ",[392,4103,2748],{},[1750,4105,4106,4110,4114],{},[1768,4107,4108],{},[392,4109,3643],{},[1768,4111,4112],{},[392,4113,4098],{},[1768,4115,4116],{},"Shortcut for static caching",[1750,4118,4119,4124,4129],{},[1768,4120,4121],{},[392,4122,4123],{},"basicAuth",[1768,4125,4126],{},[392,4127,4128],{},"{ username, password, realm? } | false",[1768,4130,4131],{},"HTTP Basic Authentication",[1750,4133,4134,4138,4142],{},[1768,4135,4136],{},[392,4137,3804],{},[1768,4139,4140],{},[392,4141,1811],{},[1768,4143,4144],{},"Enable/disable prerendering",[1750,4146,4147,4152,4157],{},[1768,4148,4149],{},[392,4150,4151],{},"isr",[1768,4153,4154],{},[392,4155,4156],{},"boolean | number | object",[1768,4158,4159],{},"Incremental Static Regeneration (Vercel)",[717,4161,4163],{"id":4162},"runtime-route-rules","Runtime route rules",[388,4165,4166,4167,4170],{},"Route rules can be provided through ",[392,4168,4169],{},"runtimeConfig",", allowing overrides via environment variables without rebuilding:",[408,4172,4174],{"className":410,"code":4173,"filename":1513,"language":413,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  runtimeConfig: {\n    nitro: {\n      routeRules: {\n        '/api/**': { headers: { 'x-env': 'production' } },\n      },\n    },\n  },\n});\n",[392,4175,4176,4188,4192,4202,4207,4212,4217,4234,4238,4242,4246],{"__ignoreMap":5},[417,4177,4178,4180,4182,4184,4186],{"class":419,"line":420},[417,4179,424],{"class":423},[417,4181,1522],{"class":430},[417,4183,434],{"class":423},[417,4185,1527],{"class":437},[417,4187,441],{"class":430},[417,4189,4190],{"class":419,"line":444},[417,4191,448],{"emptyLinePlaceholder":447},[417,4193,4194,4196,4198,4200],{"class":419,"line":451},[417,4195,454],{"class":423},[417,4197,457],{"class":423},[417,4199,1542],{"class":469},[417,4201,1545],{"class":430},[417,4203,4204],{"class":419,"line":482},[417,4205,4206],{"class":430},"  runtimeConfig: {\n",[417,4208,4209],{"class":419,"line":493},[417,4210,4211],{"class":430},"    nitro: {\n",[417,4213,4214],{"class":419,"line":556},[417,4215,4216],{"class":430},"      routeRules: {\n",[417,4218,4219,4222,4224,4227,4229,4232],{"class":419,"line":639},[417,4220,4221],{"class":437},"        '/api/**'",[417,4223,2847],{"class":430},[417,4225,4226],{"class":437},"'x-env'",[417,4228,1658],{"class":430},[417,4230,4231],{"class":437},"'production'",[417,4233,2839],{"class":430},[417,4235,4236],{"class":419,"line":645},[417,4237,3497],{"class":430},[417,4239,4240],{"class":419,"line":1249},[417,4241,1705],{"class":430},[417,4243,4244],{"class":419,"line":1259},[417,4245,1734],{"class":430},[417,4247,4248],{"class":419,"line":1708},[417,4249,559],{"class":430},[383,4251,4253],{"id":4252},"config-reference","Config reference",[388,4255,4256],{},"These config options control routing behavior:",[1744,4258,4259,4272],{},[1747,4260,4261],{},[1750,4262,4263,4265,4267,4270],{},[1753,4264,1755],{},[1753,4266,1758],{},[1753,4268,4269],{},"Default",[1753,4271,1761],{},[1763,4273,4274,4293,4315,4334,4353,4372,4392,4411,4429,4448],{},[1750,4275,4276,4281,4285,4290],{},[1768,4277,4278],{},[392,4279,4280],{},"baseURL",[1768,4282,4283],{},[392,4284,1777],{},[1768,4286,4287],{},[392,4288,4289],{},"\"/\"",[1768,4291,4292],{},"Base URL for all routes",[1750,4294,4295,4300,4304,4309],{},[1768,4296,4297],{},[392,4298,4299],{},"apiBaseURL",[1768,4301,4302],{},[392,4303,1777],{},[1768,4305,4306],{},[392,4307,4308],{},"\"/api\"",[1768,4310,4311,4312,4314],{},"Base URL for routes in the ",[392,4313,575],{}," directory",[1750,4316,4317,4322,4326,4331],{},[1768,4318,4319],{},[392,4320,4321],{},"apiDir",[1768,4323,4324],{},[392,4325,1777],{},[1768,4327,4328],{},[392,4329,4330],{},"\"api\"",[1768,4332,4333],{},"Directory name for API routes",[1750,4335,4336,4341,4345,4350],{},[1768,4337,4338],{},[392,4339,4340],{},"routesDir",[1768,4342,4343],{},[392,4344,1777],{},[1768,4346,4347],{},[392,4348,4349],{},"\"routes\"",[1768,4351,4352],{},"Directory name for file-based routes",[1750,4354,4355,4360,4365,4369],{},[1768,4356,4357],{},[392,4358,4359],{},"serverDir",[1768,4361,4362],{},[392,4363,4364],{},"string | false",[1768,4366,4367],{},[392,4368,2972],{},[1768,4370,4371],{},"Server directory for scanning routes, middleware, plugins, etc.",[1750,4373,4374,4379,4384,4389],{},[1768,4375,4376],{},[392,4377,4378],{},"scanDirs",[1768,4380,4381],{},[392,4382,4383],{},"string[]",[1768,4385,4386],{},[392,4387,4388],{},"[]",[1768,4390,4391],{},"Additional directories to scan for routes",[1750,4393,4394,4398,4403,4408],{},[1768,4395,4396],{},[392,4397,1497],{},[1768,4399,4400],{},[392,4401,4402],{},"Record\u003Cstring, string | handler>",[1768,4404,4405],{},[392,4406,4407],{},"{}",[1768,4409,4410],{},"Route-to-handler mapping",[1750,4412,4413,4417,4422,4426],{},[1768,4414,4415],{},[392,4416,1864],{},[1768,4418,4419],{},[392,4420,4421],{},"NitroEventHandler[]",[1768,4423,4424],{},[392,4425,4388],{},[1768,4427,4428],{},"Programmatic handler registration (mainly for middleware)",[1750,4430,4431,4436,4441,4445],{},[1768,4432,4433],{},[392,4434,4435],{},"routeRules",[1768,4437,4438],{},[392,4439,4440],{},"Record\u003Cstring, NitroRouteConfig>",[1768,4442,4443],{},[392,4444,4407],{},[1768,4446,4447],{},"Route rules for matching patterns",[1750,4449,4450,4454,4458,4462],{},[1768,4451,4452],{},[392,4453,1508],{},[1768,4455,4456],{},[392,4457,4383],{},[1768,4459,4460],{},[392,4461,4388],{},[1768,4463,4464],{},"Glob patterns to ignore during file scanning",[4466,4467,4468],"style",{},"html pre.shiki code .so5gQ, html code.shiki .so5gQ{--shiki-light:#D73A49;--shiki-default:#F97583;--shiki-dark:#F97583}html pre.shiki code .slsVL, html code.shiki .slsVL{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .sfrk1, html code.shiki .sfrk1{--shiki-light:#032F62;--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF}html pre.shiki code .sQHwn, html code.shiki .sQHwn{--shiki-light:#E36209;--shiki-default:#FFAB70;--shiki-dark:#FFAB70}html pre.shiki code .shcOC, html code.shiki .shcOC{--shiki-light:#6F42C1;--shiki-default:#B392F0;--shiki-dark:#B392F0}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .suiK_, html code.shiki .suiK_{--shiki-light:#005CC5;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}",{"title":5,"searchDepth":444,"depth":444,"links":4470},[4471,4472,4480,4486,4493,4494,4495,4508],{"id":385,"depth":444,"text":386},{"id":562,"depth":444,"text":563,"children":4473},[4474,4475,4476,4477,4478,4479],{"id":719,"depth":451,"text":720},{"id":789,"depth":451,"text":790},{"id":1123,"depth":451,"text":1124},{"id":1364,"depth":451,"text":1365},{"id":1438,"depth":451,"text":1439},{"id":1501,"depth":451,"text":1502},{"id":1595,"depth":444,"text":1596,"children":4481},[4482,4484],{"id":1605,"depth":451,"text":4483},"routes config",{"id":1861,"depth":451,"text":4485},"handlers config",{"id":2025,"depth":444,"text":280,"children":4487},[4488,4489,4490,4491,4492],{"id":2131,"depth":451,"text":2132},{"id":2221,"depth":451,"text":2222},{"id":2362,"depth":451,"text":2363},{"id":2453,"depth":451,"text":2454},{"id":2551,"depth":451,"text":2552},{"id":2653,"depth":444,"text":2654},{"id":2685,"depth":444,"text":2686},{"id":2709,"depth":444,"text":2710,"children":4496},[4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507],{"id":2962,"depth":451,"text":2963},{"id":3074,"depth":451,"text":3075},{"id":3157,"depth":451,"text":3158},{"id":3261,"depth":451,"text":3262},{"id":3371,"depth":451,"text":3372},{"id":3514,"depth":451,"text":3515},{"id":3630,"depth":451,"text":3631},{"id":3804,"depth":451,"text":3805},{"id":3877,"depth":451,"text":3878},{"id":3999,"depth":451,"text":4000},{"id":4162,"depth":451,"text":4163},{"id":4252,"depth":444,"text":4253},"Nitro supports filesystem routing to automatically map files to routes. By combining code-splitting with compiled routes, it removes the need for a runtime router, leaving only minimal compiled logic.",{"icon":26},{"icon":26},{"title":23,"description":4509},"xbxzkd0PMMf-Qqep-wgtbIM6ST4gKROoaWMZ-0aDHgA",[4515,4517],{"title":18,"path":19,"stem":20,"description":4516,"icon":21,"children":-1},"Use a renderer to handle all unmatched routes with custom HTML or a templating system.",{"title":28,"path":29,"stem":30,"description":5,"icon":31,"children":-1},1773242036461]