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