[{"data":1,"prerenderedAt":808},["ShallowReactive",2],{"navigation":3,"examples-nav":228,"-examples-virtual-routes":357,"-examples-virtual-routes-surround":801},[4,83,212,218,225],{"title":5,"path":6,"stem":7,"children":8,"icon":82},"","/docs","1.docs/1.index",[9,12,17,22,27,32,37,42,47,52,57,62,67,72,77],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-compass",{"title":13,"path":14,"stem":15,"icon":16},"Quick Start","/docs/quick-start","1.docs/2.quick-start","i-lucide-zap",{"title":18,"path":19,"stem":20,"icon":21},"Renderer","/docs/renderer","1.docs/4.renderer","ri:layout-masonry-line",{"title":23,"path":24,"stem":25,"icon":26},"Routing","/docs/routing","1.docs/5.routing","ri:direction-line",{"title":28,"path":29,"stem":30,"icon":31},"Assets","/docs/assets","1.docs/50.assets","ri:image-2-line",{"title":33,"path":34,"stem":35,"icon":36},"Configuration","/docs/configuration","1.docs/50.configuration","ri:settings-3-line",{"title":38,"path":39,"stem":40,"icon":41},"Database","/docs/database","1.docs/50.database","ri:database-2-line",{"title":43,"path":44,"stem":45,"icon":46},"Lifecycle","/docs/lifecycle","1.docs/50.lifecycle","i-lucide-layers",{"title":48,"path":49,"stem":50,"icon":51},"Plugins","/docs/plugins","1.docs/50.plugins","ri:plug-line",{"title":53,"path":54,"stem":55,"icon":56},"Tasks","/docs/tasks","1.docs/50.tasks","codicon:run-all",{"title":58,"path":59,"stem":60,"icon":61},"Server Entry","/docs/server-entry","1.docs/6.server-entry","ri:server-line",{"title":63,"path":64,"stem":65,"icon":66},"Cache","/docs/cache","1.docs/7.cache","ri:speed-line",{"title":68,"path":69,"stem":70,"icon":71},"KV Storage","/docs/storage","1.docs/8.storage","carbon:datastore",{"title":73,"path":74,"stem":75,"icon":76},"Migration Guide","/docs/migration","1.docs/99.migration","ri:arrow-right-up-line",{"title":78,"path":79,"stem":80,"icon":81},"Nightly Channel","/docs/nightly","1.docs/99.nightly","ri:moon-fill","i-lucide-book-open",{"title":84,"path":85,"stem":86,"children":87,"icon":89},"Deploy","/deploy","2.deploy/0.index",[88,90,111],{"title":84,"path":85,"stem":86,"icon":89},"ri:upload-cloud-2-line",{"title":91,"path":92,"stem":93,"children":94,"page":110},"Runtimes","/deploy/runtimes","2.deploy/10.runtimes",[95,100,105],{"title":96,"path":97,"stem":98,"icon":99},"Node.js","/deploy/runtimes/node","2.deploy/10.runtimes/1.node","akar-icons:node-fill",{"title":101,"path":102,"stem":103,"icon":104},"Bun","/deploy/runtimes/bun","2.deploy/10.runtimes/bun","simple-icons:bun",{"title":106,"path":107,"stem":108,"icon":109},"Deno","/deploy/runtimes/deno","2.deploy/10.runtimes/deno","simple-icons:deno",false,{"title":112,"path":113,"stem":114,"children":115,"page":110},"Providers","/deploy/providers","2.deploy/20.providers",[116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208],{"title":117,"path":118,"stem":119},"Alwaysdata","/deploy/providers/alwaysdata","2.deploy/20.providers/alwaysdata",{"title":121,"path":122,"stem":123},"AWS Lambda","/deploy/providers/aws","2.deploy/20.providers/aws",{"title":125,"path":126,"stem":127},"AWS Amplify","/deploy/providers/aws-amplify","2.deploy/20.providers/aws-amplify",{"title":129,"path":130,"stem":131},"Azure","/deploy/providers/azure","2.deploy/20.providers/azure",{"title":133,"path":134,"stem":135},"Cleavr","/deploy/providers/cleavr","2.deploy/20.providers/cleavr",{"title":137,"path":138,"stem":139},"Cloudflare","/deploy/providers/cloudflare","2.deploy/20.providers/cloudflare",{"title":141,"path":142,"stem":143},"Deno Deploy","/deploy/providers/deno-deploy","2.deploy/20.providers/deno-deploy",{"title":145,"path":146,"stem":147},"DigitalOcean","/deploy/providers/digitalocean","2.deploy/20.providers/digitalocean",{"title":149,"path":150,"stem":151},"Firebase","/deploy/providers/firebase","2.deploy/20.providers/firebase",{"title":153,"path":154,"stem":155},"Flightcontrol","/deploy/providers/flightcontrol","2.deploy/20.providers/flightcontrol",{"title":157,"path":158,"stem":159},"Genezio","/deploy/providers/genezio","2.deploy/20.providers/genezio",{"title":161,"path":162,"stem":163},"GitHub Pages","/deploy/providers/github-pages","2.deploy/20.providers/github-pages",{"title":165,"path":166,"stem":167},"GitLab Pages","/deploy/providers/gitlab-pages","2.deploy/20.providers/gitlab-pages",{"title":169,"path":170,"stem":171},"Heroku","/deploy/providers/heroku","2.deploy/20.providers/heroku",{"title":173,"path":174,"stem":175},"IIS","/deploy/providers/iis","2.deploy/20.providers/iis",{"title":177,"path":178,"stem":179},"Koyeb","/deploy/providers/koyeb","2.deploy/20.providers/koyeb",{"title":181,"path":182,"stem":183},"Netlify","/deploy/providers/netlify","2.deploy/20.providers/netlify",{"title":185,"path":186,"stem":187},"Platform.sh","/deploy/providers/platform-sh","2.deploy/20.providers/platform-sh",{"title":189,"path":190,"stem":191},"Render.com","/deploy/providers/render","2.deploy/20.providers/render",{"title":193,"path":194,"stem":195},"StormKit","/deploy/providers/stormkit","2.deploy/20.providers/stormkit",{"title":197,"path":198,"stem":199},"Vercel","/deploy/providers/vercel","2.deploy/20.providers/vercel",{"title":201,"path":202,"stem":203},"Zeabur","/deploy/providers/zeabur","2.deploy/20.providers/zeabur",{"title":205,"path":206,"stem":207},"Zephyr Cloud","/deploy/providers/zephyr","2.deploy/20.providers/zephyr",{"title":209,"path":210,"stem":211},"Zerops","/deploy/providers/zerops","2.deploy/20.providers/zerops",{"title":213,"path":214,"stem":215,"children":216,"icon":36},"Config","/config","3.config/0.index",[217],{"title":213,"path":214,"stem":215,"icon":36},{"title":219,"path":220,"stem":221,"children":222,"icon":224},"Examples","/examples","4.examples/0.index",[223],{"title":219,"path":220,"stem":221,"icon":224},"i-lucide-folder-code",{"title":5,"path":226,"stem":227},"/","index",[229,234,239,243,247,250,255,259,263,267,271,275,279,284,288,291,295,299,303,308,312,317,321,325,329,333,337,341,345,349,353],{"title":230,"description":231,"category":232,"path":233},"API Routes","File-based API routing with HTTP method support and dynamic parameters.","features","/examples/api-routes/readme",{"title":235,"description":236,"category":237,"path":238},"Auto Imports","Automatic imports for utilities and composables.","config","/examples/auto-imports/readme",{"title":240,"description":241,"category":232,"path":242},"Cached Handler","Cache route responses with configurable bypass logic.","/examples/cached-handler/readme",{"title":244,"description":245,"category":232,"path":246},"Custom Error Handler","Customize error responses with a global error handler.","/examples/custom-error-handler/readme",{"title":38,"description":248,"category":232,"path":249},"Built-in database support with SQL template literals.","/examples/database/readme",{"title":251,"description":252,"category":253,"path":254},"Elysia","Integrate Elysia with Nitro using the server entry.","backend frameworks","/examples/elysia/readme",{"title":256,"description":257,"category":253,"path":258},"Express","Integrate Express with Nitro using the server entry.","/examples/express/readme",{"title":260,"description":261,"category":253,"path":262},"Fastify","Integrate Fastify with Nitro using the server entry.","/examples/fastify/readme",{"title":264,"description":265,"category":232,"path":266},"Hello World","Minimal Nitro server using the web standard fetch handler.","/examples/hello-world/readme",{"title":268,"description":269,"category":253,"path":270},"Hono","Integrate Hono with Nitro using the server entry.","/examples/hono/readme",{"title":272,"description":273,"category":237,"path":274},"Import Alias","Custom import aliases for cleaner module paths.","/examples/import-alias/readme",{"title":276,"description":277,"category":232,"path":278},"Middleware","Request middleware for authentication, logging, and request modification.","/examples/middleware/readme",{"title":280,"description":281,"category":282,"path":283},"Mono JSX","Server-side JSX rendering in Nitro with mono-jsx.","server side rendering","/examples/mono-jsx/readme",{"title":285,"description":286,"category":282,"path":287},"Nano JSX","Server-side JSX rendering in Nitro with nano-jsx.","/examples/nano-jsx/readme",{"title":48,"description":289,"category":232,"path":290},"Extend Nitro with custom plugins for hooks and lifecycle events.","/examples/plugins/readme",{"title":292,"description":293,"category":282,"path":294},"Custom Renderer","Build a custom HTML renderer in Nitro with server-side data fetching.","/examples/renderer/readme",{"title":296,"description":297,"category":237,"path":298},"Runtime Config","Environment-aware configuration with runtime access.","/examples/runtime-config/readme",{"title":300,"description":301,"category":232,"path":302},"Server Fetch","Internal server-to-server requests without network overhead.","/examples/server-fetch/readme",{"title":304,"description":305,"category":306,"path":307},"Shiki","Server-side syntax highlighting in Nitro with Shiki.","integrations","/examples/shiki/readme",{"title":309,"description":310,"category":232,"path":311},"Virtual Routes","Define routes programmatically using Nitro's virtual module system.","/examples/virtual-routes/readme",{"title":313,"description":314,"category":315,"path":316},"Vite Nitro Plugin","Use Nitro as a Vite plugin for programmatic configuration.","vite","/examples/vite-nitro-plugin/readme",{"title":318,"description":319,"category":315,"path":320},"Vite RSC","React Server Components with Vite and Nitro.","/examples/vite-rsc/readme",{"title":322,"description":323,"category":282,"path":324},"Vite SSR HTML","Server-side rendering with vanilla HTML, Vite, and Nitro.","/examples/vite-ssr-html/readme",{"title":326,"description":327,"category":282,"path":328},"SSR with Preact","Server-side rendering with Preact in Nitro using Vite.","/examples/vite-ssr-preact/readme",{"title":330,"description":331,"category":282,"path":332},"SSR with React","Server-side rendering with React in Nitro using Vite.","/examples/vite-ssr-react/readme",{"title":334,"description":335,"category":282,"path":336},"SSR with SolidJS","Server-side rendering with SolidJS in Nitro using Vite.","/examples/vite-ssr-solid/readme",{"title":338,"description":339,"category":282,"path":340},"SSR with TanStack Router","Client-side routing with TanStack Router in Nitro using Vite.","/examples/vite-ssr-tsr-react/readme",{"title":342,"description":343,"category":282,"path":344},"SSR with TanStack Start","Full-stack React with TanStack Start in Nitro using Vite.","/examples/vite-ssr-tss-react/readme",{"title":346,"description":347,"category":282,"path":348},"SSR with Vue Router","Server-side rendering with Vue Router in Nitro using Vite.","/examples/vite-ssr-vue-router/readme",{"title":350,"description":351,"category":315,"path":352},"Vite + tRPC","End-to-end typesafe APIs with tRPC in Nitro using Vite.","/examples/vite-trpc/readme",{"title":354,"description":355,"category":232,"path":356},"WebSocket","Real-time bidirectional communication with WebSocket support.","/examples/websocket/readme",{"id":358,"title":309,"body":359,"category":232,"description":310,"extension":794,"icon":795,"meta":796,"navigation":797,"path":311,"seo":798,"stem":799,"__hash__":800},"examples/examples/virtual-routes/README.md",{"type":360,"value":361,"toc":790},"minimark",[362,667,671,675,751,766,769,773,786],[363,364,367,490,589,613],"code-tree",{":expand-all":365,"default-value":366,"expand-all":5},"true","nitro.config.ts",[368,369,373],"pre",{"className":370,"code":371,"filename":366,"language":372,"meta":5,"style":5},"language-ts shiki shiki-themes github-light github-dark github-dark","import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  routes: {\n    \"/\": \"#virtual-route\",\n  },\n  virtual: {\n    \"#virtual-route\": () =>\n      /* js */ `export default () => new Response(\"Hello from virtual entry!\")`,\n  },\n});\n","ts",[374,375,376,399,406,422,428,443,449,455,467,479,484],"code",{"__ignoreMap":5},[377,378,381,385,389,392,396],"span",{"class":379,"line":380},"line",1,[377,382,384],{"class":383},"so5gQ","import",[377,386,388],{"class":387},"slsVL"," { defineConfig } ",[377,390,391],{"class":383},"from",[377,393,395],{"class":394},"sfrk1"," \"nitro\"",[377,397,398],{"class":387},";\n",[377,400,402],{"class":379,"line":401},2,[377,403,405],{"emptyLinePlaceholder":404},true,"\n",[377,407,409,412,415,419],{"class":379,"line":408},3,[377,410,411],{"class":383},"export",[377,413,414],{"class":383}," default",[377,416,418],{"class":417},"shcOC"," defineConfig",[377,420,421],{"class":387},"({\n",[377,423,425],{"class":379,"line":424},4,[377,426,427],{"class":387},"  routes: {\n",[377,429,431,434,437,440],{"class":379,"line":430},5,[377,432,433],{"class":394},"    \"/\"",[377,435,436],{"class":387},": ",[377,438,439],{"class":394},"\"#virtual-route\"",[377,441,442],{"class":387},",\n",[377,444,446],{"class":379,"line":445},6,[377,447,448],{"class":387},"  },\n",[377,450,452],{"class":379,"line":451},7,[377,453,454],{"class":387},"  virtual: {\n",[377,456,458,461,464],{"class":379,"line":457},8,[377,459,460],{"class":394},"    \"#virtual-route\"",[377,462,463],{"class":387},": () ",[377,465,466],{"class":383},"=>\n",[377,468,470,474,477],{"class":379,"line":469},9,[377,471,473],{"class":472},"sCsY4","      /* js */",[377,475,476],{"class":394}," `export default () => new Response(\"Hello from virtual entry!\")`",[377,478,442],{"class":387},[377,480,482],{"class":379,"line":481},10,[377,483,448],{"class":387},[377,485,487],{"class":379,"line":486},11,[377,488,489],{"class":387},"});\n",[368,491,496],{"className":492,"code":493,"filename":494,"language":495,"meta":5,"style":5},"language-json shiki shiki-themes github-light github-dark github-dark","{\n  \"type\": \"module\",\n  \"scripts\": {\n    \"build\": \"nitro build\",\n    \"dev\": \"nitro dev\",\n    \"preview\": \"node .output/server/index.mjs\"\n  },\n  \"devDependencies\": {\n    \"nitro\": \"latest\"\n  }\n}\n","package.json","json",[374,497,498,503,516,524,536,548,558,562,569,579,584],{"__ignoreMap":5},[377,499,500],{"class":379,"line":380},[377,501,502],{"class":387},"{\n",[377,504,505,509,511,514],{"class":379,"line":401},[377,506,508],{"class":507},"suiK_","  \"type\"",[377,510,436],{"class":387},[377,512,513],{"class":394},"\"module\"",[377,515,442],{"class":387},[377,517,518,521],{"class":379,"line":408},[377,519,520],{"class":507},"  \"scripts\"",[377,522,523],{"class":387},": {\n",[377,525,526,529,531,534],{"class":379,"line":424},[377,527,528],{"class":507},"    \"build\"",[377,530,436],{"class":387},[377,532,533],{"class":394},"\"nitro build\"",[377,535,442],{"class":387},[377,537,538,541,543,546],{"class":379,"line":430},[377,539,540],{"class":507},"    \"dev\"",[377,542,436],{"class":387},[377,544,545],{"class":394},"\"nitro dev\"",[377,547,442],{"class":387},[377,549,550,553,555],{"class":379,"line":445},[377,551,552],{"class":507},"    \"preview\"",[377,554,436],{"class":387},[377,556,557],{"class":394},"\"node .output/server/index.mjs\"\n",[377,559,560],{"class":379,"line":451},[377,561,448],{"class":387},[377,563,564,567],{"class":379,"line":457},[377,565,566],{"class":507},"  \"devDependencies\"",[377,568,523],{"class":387},[377,570,571,574,576],{"class":379,"line":469},[377,572,573],{"class":507},"    \"nitro\"",[377,575,436],{"class":387},[377,577,578],{"class":394},"\"latest\"\n",[377,580,581],{"class":379,"line":481},[377,582,583],{"class":387},"  }\n",[377,585,586],{"class":379,"line":486},[377,587,588],{"class":387},"}\n",[368,590,593],{"className":492,"code":591,"filename":592,"language":495,"meta":5,"style":5},"{\n  \"extends\": \"nitro/tsconfig\"\n}\n","tsconfig.json",[374,594,595,599,609],{"__ignoreMap":5},[377,596,597],{"class":379,"line":380},[377,598,502],{"class":387},[377,600,601,604,606],{"class":379,"line":401},[377,602,603],{"class":507},"  \"extends\"",[377,605,436],{"class":387},[377,607,608],{"class":394},"\"nitro/tsconfig\"\n",[377,610,611],{"class":379,"line":408},[377,612,588],{"class":387},[368,614,617],{"className":370,"code":615,"filename":616,"language":372,"meta":5,"style":5},"import { defineConfig } from \"vite\";\nimport { nitro } from \"nitro/vite\";\n\nexport default defineConfig({ plugins: [nitro()] });\n","vite.config.ts",[374,618,619,632,646,650],{"__ignoreMap":5},[377,620,621,623,625,627,630],{"class":379,"line":380},[377,622,384],{"class":383},[377,624,388],{"class":387},[377,626,391],{"class":383},[377,628,629],{"class":394}," \"vite\"",[377,631,398],{"class":387},[377,633,634,636,639,641,644],{"class":379,"line":401},[377,635,384],{"class":383},[377,637,638],{"class":387}," { nitro } ",[377,640,391],{"class":383},[377,642,643],{"class":394}," \"nitro/vite\"",[377,645,398],{"class":387},[377,647,648],{"class":379,"line":408},[377,649,405],{"emptyLinePlaceholder":404},[377,651,652,654,656,658,661,664],{"class":379,"line":424},[377,653,411],{"class":383},[377,655,414],{"class":383},[377,657,418],{"class":417},[377,659,660],{"class":387},"({ plugins: [",[377,662,663],{"class":417},"nitro",[377,665,666],{"class":387},"()] });\n",[668,669,670],"p",{},"Virtual routes let you define handlers as strings in your config instead of creating separate files. This is useful when generating routes dynamically, building plugins, or keeping simple routes inline.",[672,673,33],"h2",{"id":674},"configuration",[368,676,677],{"className":370,"code":371,"filename":366,"language":372,"meta":5,"style":5},[374,678,679,691,695,705,709,719,723,727,735,743,747],{"__ignoreMap":5},[377,680,681,683,685,687,689],{"class":379,"line":380},[377,682,384],{"class":383},[377,684,388],{"class":387},[377,686,391],{"class":383},[377,688,395],{"class":394},[377,690,398],{"class":387},[377,692,693],{"class":379,"line":401},[377,694,405],{"emptyLinePlaceholder":404},[377,696,697,699,701,703],{"class":379,"line":408},[377,698,411],{"class":383},[377,700,414],{"class":383},[377,702,418],{"class":417},[377,704,421],{"class":387},[377,706,707],{"class":379,"line":424},[377,708,427],{"class":387},[377,710,711,713,715,717],{"class":379,"line":430},[377,712,433],{"class":394},[377,714,436],{"class":387},[377,716,439],{"class":394},[377,718,442],{"class":387},[377,720,721],{"class":379,"line":445},[377,722,448],{"class":387},[377,724,725],{"class":379,"line":451},[377,726,454],{"class":387},[377,728,729,731,733],{"class":379,"line":457},[377,730,460],{"class":394},[377,732,463],{"class":387},[377,734,466],{"class":383},[377,736,737,739,741],{"class":379,"line":469},[377,738,473],{"class":472},[377,740,476],{"class":394},[377,742,442],{"class":387},[377,744,745],{"class":379,"line":481},[377,746,448],{"class":387},[377,748,749],{"class":379,"line":486},[377,750,489],{"class":387},[668,752,753,754,757,758,761,762,765],{},"The ",[374,755,756],{},"routes"," option maps URL paths to virtual module identifiers (prefixed with ",[374,759,760],{},"#","). The ",[374,763,764],{},"virtual"," option defines the module content as a string or function returning a string. At build time, Nitro resolves these virtual modules to actual handlers.",[668,767,768],{},"There are no route files in this project. The entire handler is defined inline in the config, and Nitro generates the route at build time.",[672,770,772],{"id":771},"learn-more","Learn More",[774,775,776,782],"ul",{},[777,778,779],"li",{},[780,781,23],"a",{"href":24},[777,783,784],{},[780,785,33],{"href":34},[787,788,789],"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 .shcOC, html code.shiki .shcOC{--shiki-light:#6F42C1;--shiki-default:#B392F0;--shiki-dark:#B392F0}html pre.shiki code .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}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 .suiK_, html code.shiki .suiK_{--shiki-light:#005CC5;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}",{"title":5,"searchDepth":401,"depth":401,"links":791},[792,793],{"id":674,"depth":401,"text":33},{"id":771,"depth":401,"text":772},"md","i-lucide-box",{"automd":404},{},{"title":309,"description":310},"examples/virtual-routes/README","VL2fd-tPhIvh29EApvuliKYXNNQI8chw_Eg3uzB9G7I",[802,805],{"title":300,"path":803,"stem":804,"description":301,"children":-1},"/examples/server-fetch","examples/server-fetch/README",{"title":354,"path":806,"stem":807,"description":355,"children":-1},"/examples/websocket","examples/websocket/README",1773176189431]