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