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