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