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