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