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