[{"data":1,"prerenderedAt":2520},["ShallowReactive",2],{"navigation":3,"-docs-renderer":394,"-docs-renderer-surround":2515},[4,88,217,223,379,391],{"title":5,"path":6,"stem":7,"children":8,"icon":87},"","/docs","1.docs/1.index",[9,12,17,22,27,32,37,42,47,52,57,62,67,72,77,82],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-compass",{"title":13,"path":14,"stem":15,"icon":16},"Quick Start","/docs/quick-start","1.docs/2.quick-start","i-lucide-zap",{"title":18,"path":19,"stem":20,"icon":21},"Renderer","/docs/renderer","1.docs/4.renderer","ri:layout-masonry-line",{"title":23,"path":24,"stem":25,"icon":26},"Routing","/docs/routing","1.docs/5.routing","ri:direction-line",{"title":28,"path":29,"stem":30,"icon":31},"Assets","/docs/assets","1.docs/50.assets","ri:image-2-line",{"title":33,"path":34,"stem":35,"icon":36},"Configuration","/docs/configuration","1.docs/50.configuration","ri:settings-3-line",{"title":38,"path":39,"stem":40,"icon":41},"Database","/docs/database","1.docs/50.database","ri:database-2-line",{"title":43,"path":44,"stem":45,"icon":46},"Lifecycle","/docs/lifecycle","1.docs/50.lifecycle","i-lucide-layers",{"title":48,"path":49,"stem":50,"icon":51},"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},"Server Entry","/docs/server-entry","1.docs/6.server-entry","ri:server-line",{"title":68,"path":69,"stem":70,"icon":71},"Cache","/docs/cache","1.docs/7.cache","ri:speed-line",{"title":73,"path":74,"stem":75,"icon":76},"KV Storage","/docs/storage","1.docs/8.storage","carbon:datastore",{"title":78,"path":79,"stem":80,"icon":81},"Migration Guide","/docs/migration","1.docs/99.migration","ri:arrow-right-up-line",{"title":83,"path":84,"stem":85,"icon":86},"Nightly Channel","/docs/nightly","1.docs/99.nightly","ri:moon-fill","i-lucide-book-open",{"title":89,"path":90,"stem":91,"children":92,"icon":94},"Deploy","/deploy","2.deploy/0.index",[93,95,116],{"title":89,"path":90,"stem":91,"icon":94},"ri:upload-cloud-2-line",{"title":96,"path":97,"stem":98,"children":99,"page":115},"Runtimes","/deploy/runtimes","2.deploy/10.runtimes",[100,105,110],{"title":101,"path":102,"stem":103,"icon":104},"Node.js","/deploy/runtimes/node","2.deploy/10.runtimes/1.node","akar-icons:node-fill",{"title":106,"path":107,"stem":108,"icon":109},"Bun","/deploy/runtimes/bun","2.deploy/10.runtimes/bun","simple-icons:bun",{"title":111,"path":112,"stem":113,"icon":114},"Deno","/deploy/runtimes/deno","2.deploy/10.runtimes/deno","simple-icons:deno",false,{"title":117,"path":118,"stem":119,"children":120,"page":115},"Providers","/deploy/providers","2.deploy/20.providers",[121,125,129,133,137,141,145,149,153,157,161,165,169,173,177,181,185,189,193,197,201,205,209,213],{"title":122,"path":123,"stem":124},"Alwaysdata","/deploy/providers/alwaysdata","2.deploy/20.providers/alwaysdata",{"title":126,"path":127,"stem":128},"AWS Lambda","/deploy/providers/aws","2.deploy/20.providers/aws",{"title":130,"path":131,"stem":132},"AWS Amplify","/deploy/providers/aws-amplify","2.deploy/20.providers/aws-amplify",{"title":134,"path":135,"stem":136},"Azure","/deploy/providers/azure","2.deploy/20.providers/azure",{"title":138,"path":139,"stem":140},"Cleavr","/deploy/providers/cleavr","2.deploy/20.providers/cleavr",{"title":142,"path":143,"stem":144},"Cloudflare","/deploy/providers/cloudflare","2.deploy/20.providers/cloudflare",{"title":146,"path":147,"stem":148},"Deno Deploy","/deploy/providers/deno-deploy","2.deploy/20.providers/deno-deploy",{"title":150,"path":151,"stem":152},"DigitalOcean","/deploy/providers/digitalocean","2.deploy/20.providers/digitalocean",{"title":154,"path":155,"stem":156},"Firebase","/deploy/providers/firebase","2.deploy/20.providers/firebase",{"title":158,"path":159,"stem":160},"Flightcontrol","/deploy/providers/flightcontrol","2.deploy/20.providers/flightcontrol",{"title":162,"path":163,"stem":164},"Genezio","/deploy/providers/genezio","2.deploy/20.providers/genezio",{"title":166,"path":167,"stem":168},"GitHub Pages","/deploy/providers/github-pages","2.deploy/20.providers/github-pages",{"title":170,"path":171,"stem":172},"GitLab Pages","/deploy/providers/gitlab-pages","2.deploy/20.providers/gitlab-pages",{"title":174,"path":175,"stem":176},"Heroku","/deploy/providers/heroku","2.deploy/20.providers/heroku",{"title":178,"path":179,"stem":180},"IIS","/deploy/providers/iis","2.deploy/20.providers/iis",{"title":182,"path":183,"stem":184},"Koyeb","/deploy/providers/koyeb","2.deploy/20.providers/koyeb",{"title":186,"path":187,"stem":188},"Netlify","/deploy/providers/netlify","2.deploy/20.providers/netlify",{"title":190,"path":191,"stem":192},"Platform.sh","/deploy/providers/platform-sh","2.deploy/20.providers/platform-sh",{"title":194,"path":195,"stem":196},"Render.com","/deploy/providers/render","2.deploy/20.providers/render",{"title":198,"path":199,"stem":200},"StormKit","/deploy/providers/stormkit","2.deploy/20.providers/stormkit",{"title":202,"path":203,"stem":204},"Vercel","/deploy/providers/vercel","2.deploy/20.providers/vercel",{"title":206,"path":207,"stem":208},"Zeabur","/deploy/providers/zeabur","2.deploy/20.providers/zeabur",{"title":210,"path":211,"stem":212},"Zephyr Cloud","/deploy/providers/zephyr","2.deploy/20.providers/zephyr",{"title":214,"path":215,"stem":216},"Zerops","/deploy/providers/zerops","2.deploy/20.providers/zerops",{"title":218,"path":219,"stem":220,"children":221,"icon":36},"Config","/config","3.config/0.index",[222],{"title":218,"path":219,"stem":220,"icon":36},{"title":224,"path":225,"stem":226,"children":227,"icon":229},"Examples","/examples","4.examples/0.index",[228,230,235,240,245,250,254,259,264,269,274,279,284,288,293,297,301,306,311,316,321,326,331,336,341,346,350,355,360,364,369,374],{"title":224,"path":225,"stem":226,"icon":229},"i-lucide-folder-code",{"title":231,"path":232,"stem":233,"icon":234},"API Routes","/examples/api-routes","4.examples/api-routes","i-lucide-route",{"title":236,"path":237,"stem":238,"icon":239},"Auto Imports","/examples/auto-imports","4.examples/auto-imports","i-lucide-import",{"title":241,"path":242,"stem":243,"icon":244},"Cached Handler","/examples/cached-handler","4.examples/cached-handler","i-lucide-clock",{"title":246,"path":247,"stem":248,"icon":249},"Custom Error Handler","/examples/custom-error-handler","4.examples/custom-error-handler","i-lucide-alert-circle",{"title":38,"path":251,"stem":252,"icon":253},"/examples/database","4.examples/database","i-lucide-database",{"title":255,"path":256,"stem":257,"icon":258},"Elysia","/examples/elysia","4.examples/elysia","i-skill-icons-elysia-dark",{"title":260,"path":261,"stem":262,"icon":263},"Express","/examples/express","4.examples/express","i-simple-icons-express",{"title":265,"path":266,"stem":267,"icon":268},"Fastify","/examples/fastify","4.examples/fastify","i-simple-icons-fastify",{"title":270,"path":271,"stem":272,"icon":273},"Hello World","/examples/hello-world","4.examples/hello-world","i-lucide-sparkles",{"title":275,"path":276,"stem":277,"icon":278},"Hono","/examples/hono","4.examples/hono","i-logos-hono",{"title":280,"path":281,"stem":282,"icon":283},"Import Alias","/examples/import-alias","4.examples/import-alias","i-lucide-at-sign",{"title":285,"path":286,"stem":287,"icon":46},"Middleware","/examples/middleware","4.examples/middleware",{"title":289,"path":290,"stem":291,"icon":292},"Mono JSX","/examples/mono-jsx","4.examples/mono-jsx","i-lucide-brackets",{"title":294,"path":295,"stem":296,"icon":292},"Nano JSX","/examples/nano-jsx","4.examples/nano-jsx",{"title":53,"path":298,"stem":299,"icon":300},"/examples/plugins","4.examples/plugins","i-lucide-plug",{"title":302,"path":303,"stem":304,"icon":305},"Custom Renderer","/examples/renderer","4.examples/renderer","i-lucide-code",{"title":307,"path":308,"stem":309,"icon":310},"Runtime Config","/examples/runtime-config","4.examples/runtime-config","i-lucide-settings",{"title":312,"path":313,"stem":314,"icon":315},"Server Fetch","/examples/server-fetch","4.examples/server-fetch","i-lucide-arrow-right-left",{"title":317,"path":318,"stem":319,"icon":320},"Shiki","/examples/shiki","4.examples/shiki","i-lucide-highlighter",{"title":322,"path":323,"stem":324,"icon":325},"Virtual Routes","/examples/virtual-routes","4.examples/virtual-routes","i-lucide-box",{"title":327,"path":328,"stem":329,"icon":330},"Vite Nitro Plugin","/examples/vite-nitro-plugin","4.examples/vite-nitro-plugin","i-logos-vitejs",{"title":332,"path":333,"stem":334,"icon":335},"Vite RSC","/examples/vite-rsc","4.examples/vite-rsc","i-logos-react",{"title":337,"path":338,"stem":339,"icon":340},"Vite SSR HTML","/examples/vite-ssr-html","4.examples/vite-ssr-html","i-logos-html-5",{"title":342,"path":343,"stem":344,"icon":345},"SSR with Preact","/examples/vite-ssr-preact","4.examples/vite-ssr-preact","i-logos-preact",{"title":347,"path":348,"stem":349,"icon":335},"SSR with React","/examples/vite-ssr-react","4.examples/vite-ssr-react",{"title":351,"path":352,"stem":353,"icon":354},"SSR with SolidJS","/examples/vite-ssr-solid","4.examples/vite-ssr-solid","i-logos-solidjs-icon",{"title":356,"path":357,"stem":358,"icon":359},"SSR with TanStack Router","/examples/vite-ssr-tsr-react","4.examples/vite-ssr-tsr-react","i-simple-icons-tanstack",{"title":361,"path":362,"stem":363,"icon":359},"SSR with TanStack Start","/examples/vite-ssr-tss-react","4.examples/vite-ssr-tss-react",{"title":365,"path":366,"stem":367,"icon":368},"SSR with Vue Router","/examples/vite-ssr-vue-router","4.examples/vite-ssr-vue-router","i-logos-vue",{"title":370,"path":371,"stem":372,"icon":373},"Vite + tRPC","/examples/vite-trpc","4.examples/vite-trpc","i-simple-icons-trpc",{"title":375,"path":376,"stem":377,"icon":378},"WebSocket","/examples/websocket","4.examples/websocket","i-lucide-radio",{"title":380,"path":381,"stem":382,"children":383},"Blog","/blog","9.blog",[384,387],{"title":380,"path":381,"stem":385,"icon":386},"9.blog/index","i-lucide-file-text",{"title":388,"path":389,"stem":390,"icon":386},"Nitro v3 Beta is here!","/blog/v3-beta","9.blog/1.v3-beta",{"title":5,"path":392,"stem":393},"/","index",{"id":395,"title":396,"body":397,"description":2510,"extension":2232,"meta":2511,"navigation":2512,"path":19,"seo":2513,"stem":20,"__hash__":2514},"content/1.docs/4.renderer.md","Nitro Renderer",{"type":398,"value":399,"toc":2489,"icon":21},"minimark",[400,404,408,416,535,606,617,621,628,634,637,904,915,918,940,944,951,1145,1149,1158,1164,1225,1228,1232,1241,1246,1264,1307,1311,1318,1451,1455,1461,1543,1547,1554,1614,1618,1621,1708,1712,1769,1940,1944,1948,1951,1961,2129,2132,2182,2194,2198,2209,2228,2260,2270,2272,2276,2279,2283,2293,2300,2313,2456,2460,2466,2470,2474,2480,2485],[401,402,403],"p",{},"The renderer is a special handler in Nitro that catches all routes that don't match any specific API or route handler. It's commonly used for server-side rendering (SSR), serving single-page applications (SPAs), or creating custom HTML responses.",[405,406,33],"h2",{"id":407},"configuration",[401,409,410,411,415],{},"The renderer is configured using the ",[412,413,414],"code",{},"renderer"," option in your Nitro config:",[417,418,423],"pre",{"className":419,"code":420,"filename":421,"language":422,"meta":5,"style":5},"language-ts shiki shiki-themes github-light github-dark github-dark","import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  renderer: {\n    template: './index.html',  // Path to HTML template file\n    handler: './renderer.ts',  // Path to custom renderer handler\n    static: false,             // Treat template as static HTML (no rendu processing)\n  }\n})\n","nitro.config.ts","ts",[412,424,425,448,455,471,477,493,507,523,529],{"__ignoreMap":5},[426,427,430,434,438,441,445],"span",{"class":428,"line":429},"line",1,[426,431,433],{"class":432},"so5gQ","import",[426,435,437],{"class":436},"slsVL"," { defineNitroConfig } ",[426,439,440],{"class":432},"from",[426,442,444],{"class":443},"sfrk1"," \"nitro/config\"",[426,446,447],{"class":436},";\n",[426,449,451],{"class":428,"line":450},2,[426,452,454],{"emptyLinePlaceholder":453},true,"\n",[426,456,458,461,464,468],{"class":428,"line":457},3,[426,459,460],{"class":432},"export",[426,462,463],{"class":432}," default",[426,465,467],{"class":466},"shcOC"," defineNitroConfig",[426,469,470],{"class":436},"({\n",[426,472,474],{"class":428,"line":473},4,[426,475,476],{"class":436},"  renderer: {\n",[426,478,480,483,486,489],{"class":428,"line":479},5,[426,481,482],{"class":436},"    template: ",[426,484,485],{"class":443},"'./index.html'",[426,487,488],{"class":436},",  ",[426,490,492],{"class":491},"sCsY4","// Path to HTML template file\n",[426,494,496,499,502,504],{"class":428,"line":495},6,[426,497,498],{"class":436},"    handler: ",[426,500,501],{"class":443},"'./renderer.ts'",[426,503,488],{"class":436},[426,505,506],{"class":491},"// Path to custom renderer handler\n",[426,508,510,513,517,520],{"class":428,"line":509},7,[426,511,512],{"class":436},"    static: ",[426,514,516],{"class":515},"suiK_","false",[426,518,519],{"class":436},",             ",[426,521,522],{"class":491},"// Treat template as static HTML (no rendu processing)\n",[426,524,526],{"class":428,"line":525},8,[426,527,528],{"class":436},"  }\n",[426,530,532],{"class":428,"line":531},9,[426,533,534],{"class":436},"})\n",[536,537,538,554],"table",{},[539,540,541],"thead",{},[542,543,544,548,551],"tr",{},[545,546,547],"th",{},"Option",[545,549,550],{},"Type",[545,552,553],{},"Description",[555,556,557,573,587],"tbody",{},[542,558,559,565,570],{},[560,561,562],"td",{},[412,563,564],{},"template",[560,566,567],{},[412,568,569],{},"string",[560,571,572],{},"Path to an HTML file used as the renderer template.",[542,574,575,580,584],{},[560,576,577],{},[412,578,579],{},"handler",[560,581,582],{},[412,583,569],{},[560,585,586],{},"Path to a custom renderer handler module.",[542,588,589,594,599],{},[560,590,591],{},[412,592,593],{},"static",[560,595,596],{},[412,597,598],{},"boolean",[560,600,601,602,605],{},"When ",[412,603,604],{},"true",", skips rendu template processing and serves the HTML as-is. Auto-detected based on template syntax when not set.",[401,607,608,609,612,613,616],{},"Set ",[412,610,611],{},"renderer: false"," in the config to explicitly disable the renderer entirely (including auto-detection of ",[412,614,615],{},"index.html",").",[405,618,620],{"id":619},"html-template","HTML template",[622,623,625,626],"h3",{"id":624},"auto-detected-indexhtml","Auto-detected ",[412,627,615],{},[401,629,630,631,633],{},"By default, Nitro automatically looks for an ",[412,632,615],{}," file in your project src dir.",[401,635,636],{},"If found, Nitro will use it as the renderer template and serve it for all unmatched routes.",[638,639,640,836],"code-group",{},[417,641,645],{"className":642,"code":643,"filename":615,"language":644,"meta":5,"style":5},"language-html shiki shiki-themes github-light github-dark github-dark","\u003C!DOCTYPE html>\n\u003Chtml lang=\"en\">\n  \u003Chead>\n    \u003Cmeta charset=\"UTF-8\" />\n    \u003Cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    \u003Ctitle>My Vite + Nitro App\u003C/title>\n  \u003C/head>\n  \u003Cbody>\n    \u003Cdiv id=\"app\">\u003C/div>\n    \u003Cscript type=\"module\" src=\"/src/main.ts\">\u003C/script>\n  \u003C/body>\n\u003C/html>\n","html",[412,646,647,662,680,690,709,733,747,756,765,787,817,826],{"__ignoreMap":5},[426,648,649,652,656,659],{"class":428,"line":429},[426,650,651],{"class":436},"\u003C!",[426,653,655],{"class":654},"sByVh","DOCTYPE",[426,657,658],{"class":466}," html",[426,660,661],{"class":436},">\n",[426,663,664,667,669,672,675,678],{"class":428,"line":450},[426,665,666],{"class":436},"\u003C",[426,668,644],{"class":654},[426,670,671],{"class":466}," lang",[426,673,674],{"class":436},"=",[426,676,677],{"class":443},"\"en\"",[426,679,661],{"class":436},[426,681,682,685,688],{"class":428,"line":457},[426,683,684],{"class":436},"  \u003C",[426,686,687],{"class":654},"head",[426,689,661],{"class":436},[426,691,692,695,698,701,703,706],{"class":428,"line":473},[426,693,694],{"class":436},"    \u003C",[426,696,697],{"class":654},"meta",[426,699,700],{"class":466}," charset",[426,702,674],{"class":436},[426,704,705],{"class":443},"\"UTF-8\"",[426,707,708],{"class":436}," />\n",[426,710,711,713,715,718,720,723,726,728,731],{"class":428,"line":479},[426,712,694],{"class":436},[426,714,697],{"class":654},[426,716,717],{"class":466}," name",[426,719,674],{"class":436},[426,721,722],{"class":443},"\"viewport\"",[426,724,725],{"class":466}," content",[426,727,674],{"class":436},[426,729,730],{"class":443},"\"width=device-width, initial-scale=1.0\"",[426,732,708],{"class":436},[426,734,735,737,740,743,745],{"class":428,"line":495},[426,736,694],{"class":436},[426,738,739],{"class":654},"title",[426,741,742],{"class":436},">My Vite + Nitro App\u003C/",[426,744,739],{"class":654},[426,746,661],{"class":436},[426,748,749,752,754],{"class":428,"line":509},[426,750,751],{"class":436},"  \u003C/",[426,753,687],{"class":654},[426,755,661],{"class":436},[426,757,758,760,763],{"class":428,"line":525},[426,759,684],{"class":436},[426,761,762],{"class":654},"body",[426,764,661],{"class":436},[426,766,767,769,772,775,777,780,783,785],{"class":428,"line":531},[426,768,694],{"class":436},[426,770,771],{"class":654},"div",[426,773,774],{"class":466}," id",[426,776,674],{"class":436},[426,778,779],{"class":443},"\"app\"",[426,781,782],{"class":436},">\u003C/",[426,784,771],{"class":654},[426,786,661],{"class":436},[426,788,790,792,795,798,800,803,806,808,811,813,815],{"class":428,"line":789},10,[426,791,694],{"class":436},[426,793,794],{"class":654},"script",[426,796,797],{"class":466}," type",[426,799,674],{"class":436},[426,801,802],{"class":443},"\"module\"",[426,804,805],{"class":466}," src",[426,807,674],{"class":436},[426,809,810],{"class":443},"\"/src/main.ts\"",[426,812,782],{"class":436},[426,814,794],{"class":654},[426,816,661],{"class":436},[426,818,820,822,824],{"class":428,"line":819},11,[426,821,751],{"class":436},[426,823,762],{"class":654},[426,825,661],{"class":436},[426,827,829,832,834],{"class":428,"line":828},12,[426,830,831],{"class":436},"\u003C/",[426,833,644],{"class":654},[426,835,661],{"class":436},[417,837,840],{"className":419,"code":838,"filename":839,"language":422,"meta":5,"style":5},"import { defineHandler } from \"nitro\";\n\nexport default defineHandler((event) => {\n  return { hello: \"API\" };\n});\n","routes/api/hello.ts",[412,841,842,856,860,885,899],{"__ignoreMap":5},[426,843,844,846,849,851,854],{"class":428,"line":429},[426,845,433],{"class":432},[426,847,848],{"class":436}," { defineHandler } ",[426,850,440],{"class":432},[426,852,853],{"class":443}," \"nitro\"",[426,855,447],{"class":436},[426,857,858],{"class":428,"line":450},[426,859,454],{"emptyLinePlaceholder":453},[426,861,862,864,866,869,872,876,879,882],{"class":428,"line":457},[426,863,460],{"class":432},[426,865,463],{"class":432},[426,867,868],{"class":466}," defineHandler",[426,870,871],{"class":436},"((",[426,873,875],{"class":874},"sQHwn","event",[426,877,878],{"class":436},") ",[426,880,881],{"class":432},"=>",[426,883,884],{"class":436}," {\n",[426,886,887,890,893,896],{"class":428,"line":473},[426,888,889],{"class":432},"  return",[426,891,892],{"class":436}," { hello: ",[426,894,895],{"class":443},"\"API\"",[426,897,898],{"class":436}," };\n",[426,900,901],{"class":428,"line":479},[426,902,903],{"class":436},"});\n",[905,906,907],"tip",{},[401,908,601,909,911,912],{},[412,910,615],{}," is detected, Nitro will automatically log in the terminal: ",[412,913,914],{},"Using index.html as renderer template.",[401,916,917],{},"With this setup:",[919,920,921,928],"ul",{},[922,923,924,927],"li",{},[412,925,926],{},"/api/hello"," → Handled by your API routes",[922,929,930,933,934,937,938],{},[412,931,932],{},"/about",", ",[412,935,936],{},"/contact",", etc. → Served with ",[412,939,615],{},[622,941,943],{"id":942},"custom-html-file","Custom HTML file",[401,945,946,947,950],{},"You can specify a custom HTML template file using the ",[412,948,949],{},"renderer.template"," option in your Nitro configuration.",[638,952,953,1003],{},[417,954,956],{"className":419,"code":955,"filename":421,"language":422,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  renderer: {\n    template: './app.html'\n  }\n})\n",[412,957,958,970,974,984,988,995,999],{"__ignoreMap":5},[426,959,960,962,964,966,968],{"class":428,"line":429},[426,961,433],{"class":432},[426,963,437],{"class":436},[426,965,440],{"class":432},[426,967,444],{"class":443},[426,969,447],{"class":436},[426,971,972],{"class":428,"line":450},[426,973,454],{"emptyLinePlaceholder":453},[426,975,976,978,980,982],{"class":428,"line":457},[426,977,460],{"class":432},[426,979,463],{"class":432},[426,981,467],{"class":466},[426,983,470],{"class":436},[426,985,986],{"class":428,"line":473},[426,987,476],{"class":436},[426,989,990,992],{"class":428,"line":479},[426,991,482],{"class":436},[426,993,994],{"class":443},"'./app.html'\n",[426,996,997],{"class":428,"line":495},[426,998,528],{"class":436},[426,1000,1001],{"class":428,"line":509},[426,1002,534],{"class":436},[417,1004,1007],{"className":642,"code":1005,"filename":1006,"language":644,"meta":5,"style":5},"\u003C!DOCTYPE html>\n\u003Chtml lang=\"en\">\n  \u003Chead>\n    \u003Cmeta charset=\"UTF-8\" />\n    \u003Ctitle>Custom Template\u003C/title>\n  \u003C/head>\n  \u003Cbody>\n    \u003Cdiv id=\"root\">Loading...\u003C/div>\n    \u003Cscript type=\"module\" src=\"/src/main.js\">\u003C/script>\n  \u003C/body>\n\u003C/html>\n","app.html",[412,1008,1009,1019,1033,1041,1055,1068,1076,1084,1104,1129,1137],{"__ignoreMap":5},[426,1010,1011,1013,1015,1017],{"class":428,"line":429},[426,1012,651],{"class":436},[426,1014,655],{"class":654},[426,1016,658],{"class":466},[426,1018,661],{"class":436},[426,1020,1021,1023,1025,1027,1029,1031],{"class":428,"line":450},[426,1022,666],{"class":436},[426,1024,644],{"class":654},[426,1026,671],{"class":466},[426,1028,674],{"class":436},[426,1030,677],{"class":443},[426,1032,661],{"class":436},[426,1034,1035,1037,1039],{"class":428,"line":457},[426,1036,684],{"class":436},[426,1038,687],{"class":654},[426,1040,661],{"class":436},[426,1042,1043,1045,1047,1049,1051,1053],{"class":428,"line":473},[426,1044,694],{"class":436},[426,1046,697],{"class":654},[426,1048,700],{"class":466},[426,1050,674],{"class":436},[426,1052,705],{"class":443},[426,1054,708],{"class":436},[426,1056,1057,1059,1061,1064,1066],{"class":428,"line":479},[426,1058,694],{"class":436},[426,1060,739],{"class":654},[426,1062,1063],{"class":436},">Custom Template\u003C/",[426,1065,739],{"class":654},[426,1067,661],{"class":436},[426,1069,1070,1072,1074],{"class":428,"line":495},[426,1071,751],{"class":436},[426,1073,687],{"class":654},[426,1075,661],{"class":436},[426,1077,1078,1080,1082],{"class":428,"line":509},[426,1079,684],{"class":436},[426,1081,762],{"class":654},[426,1083,661],{"class":436},[426,1085,1086,1088,1090,1092,1094,1097,1100,1102],{"class":428,"line":525},[426,1087,694],{"class":436},[426,1089,771],{"class":654},[426,1091,774],{"class":466},[426,1093,674],{"class":436},[426,1095,1096],{"class":443},"\"root\"",[426,1098,1099],{"class":436},">Loading...\u003C/",[426,1101,771],{"class":654},[426,1103,661],{"class":436},[426,1105,1106,1108,1110,1112,1114,1116,1118,1120,1123,1125,1127],{"class":428,"line":531},[426,1107,694],{"class":436},[426,1109,794],{"class":654},[426,1111,797],{"class":466},[426,1113,674],{"class":436},[426,1115,802],{"class":443},[426,1117,805],{"class":466},[426,1119,674],{"class":436},[426,1121,1122],{"class":443},"\"/src/main.js\"",[426,1124,782],{"class":436},[426,1126,794],{"class":654},[426,1128,661],{"class":436},[426,1130,1131,1133,1135],{"class":428,"line":789},[426,1132,751],{"class":436},[426,1134,762],{"class":654},[426,1136,661],{"class":436},[426,1138,1139,1141,1143],{"class":428,"line":819},[426,1140,831],{"class":436},[426,1142,644],{"class":654},[426,1144,661],{"class":436},[622,1146,1148],{"id":1147},"static-templates","Static templates",[401,1150,1151,1152,1157],{},"By default, Nitro auto-detects whether your HTML template contains ",[1153,1154,1156],"a",{"href":1155},"#hypertext-preprocessor-experimental","rendu"," syntax. If it does, the template is processed dynamically on each request. If it doesn't, it's served as static HTML.",[401,1159,1160,1161,1163],{},"You can override this behavior with the ",[412,1162,593],{}," option:",[417,1165,1167],{"className":419,"code":1166,"filename":421,"language":422,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  renderer: {\n    template: './index.html',\n    static: true // Force static serving, skip template processing\n  }\n})\n",[412,1168,1169,1181,1185,1195,1199,1208,1217,1221],{"__ignoreMap":5},[426,1170,1171,1173,1175,1177,1179],{"class":428,"line":429},[426,1172,433],{"class":432},[426,1174,437],{"class":436},[426,1176,440],{"class":432},[426,1178,444],{"class":443},[426,1180,447],{"class":436},[426,1182,1183],{"class":428,"line":450},[426,1184,454],{"emptyLinePlaceholder":453},[426,1186,1187,1189,1191,1193],{"class":428,"line":457},[426,1188,460],{"class":432},[426,1190,463],{"class":432},[426,1192,467],{"class":466},[426,1194,470],{"class":436},[426,1196,1197],{"class":428,"line":473},[426,1198,476],{"class":436},[426,1200,1201,1203,1205],{"class":428,"line":479},[426,1202,482],{"class":436},[426,1204,485],{"class":443},[426,1206,1207],{"class":436},",\n",[426,1209,1210,1212,1214],{"class":428,"line":495},[426,1211,512],{"class":436},[426,1213,604],{"class":515},[426,1215,1216],{"class":491}," // Force static serving, skip template processing\n",[426,1218,1219],{"class":428,"line":509},[426,1220,528],{"class":436},[426,1222,1223],{"class":428,"line":525},[426,1224,534],{"class":436},[401,1226,1227],{},"In production, static templates are inlined into the server bundle and served directly for optimal performance.",[622,1229,1231],{"id":1230},"hypertext-preprocessor-experimental","Hypertext Preprocessor (experimental)",[401,1233,1234,1235,1240],{},"Nitro uses ",[1153,1236,1156],{"href":1237,"rel":1238},"https://github.com/h3js/rendu",[1239],"nofollow"," Hypertext Preprocessor, which provides a simple and powerful way to create dynamic HTML templates with JavaScript expressions.",[1242,1243,1245],"h4",{"id":1244},"output-expressions","Output expressions",[919,1247,1248,1254],{},[922,1249,1250,1253],{},[412,1251,1252],{},"{{ expression }}"," — HTML-escaped output",[922,1255,1256,1259,1260,1263],{},[412,1257,1258],{},"{{{ expression }}}"," or ",[412,1261,1262],{},"\u003C?= expression ?>"," — raw (unescaped) output",[417,1265,1267],{"className":642,"code":1266,"language":644,"meta":5,"style":5},"\u003Ch1>Hello {{ $URL.pathname }}\u003C/h1>\n\u003Cdiv>{{{ '\u003Cstrong>raw html\u003C/strong>' }}}\u003C/div>\n",[412,1268,1269,1283],{"__ignoreMap":5},[426,1270,1271,1273,1276,1279,1281],{"class":428,"line":429},[426,1272,666],{"class":436},[426,1274,1275],{"class":654},"h1",[426,1277,1278],{"class":436},">Hello {{ $URL.pathname }}\u003C/",[426,1280,1275],{"class":654},[426,1282,661],{"class":436},[426,1284,1285,1287,1289,1292,1295,1298,1300,1303,1305],{"class":428,"line":450},[426,1286,666],{"class":436},[426,1288,771],{"class":654},[426,1290,1291],{"class":436},">{{{ '\u003C",[426,1293,1294],{"class":654},"strong",[426,1296,1297],{"class":436},">raw html\u003C/",[426,1299,1294],{"class":654},[426,1301,1302],{"class":436},">' }}}\u003C/",[426,1304,771],{"class":654},[426,1306,661],{"class":436},[1242,1308,1310],{"id":1309},"control-flow","Control flow",[401,1312,1313,1314,1317],{},"Use ",[412,1315,1316],{},"\u003C? ... ?>"," for JavaScript control flow:",[417,1319,1321],{"className":642,"code":1320,"language":644,"meta":5,"style":5},"\u003C? if ($METHOD === 'POST') { ?>\n  \u003Cp>Form submitted!\u003C/p>\n\u003C? } else { ?>\n  \u003Cform method=\"POST\">\n    \u003Cbutton type=\"submit\">Submit\u003C/button>\n  \u003C/form>\n\u003C? } ?>\n\n\u003Cul>\n\u003C? for (const item of ['a', 'b', 'c']) { ?>\n  \u003Cli>{{ item }}\u003C/li>\n\u003C? } ?>\n\u003C/ul>\n",[412,1322,1323,1331,1344,1351,1368,1389,1397,1404,1408,1416,1423,1436,1442],{"__ignoreMap":5},[426,1324,1325,1328],{"class":428,"line":429},[426,1326,666],{"class":1327},"sVAnh",[426,1329,1330],{"class":436},"? if ($METHOD === 'POST') { ?>\n",[426,1332,1333,1335,1337,1340,1342],{"class":428,"line":450},[426,1334,684],{"class":436},[426,1336,401],{"class":654},[426,1338,1339],{"class":436},">Form submitted!\u003C/",[426,1341,401],{"class":654},[426,1343,661],{"class":436},[426,1345,1346,1348],{"class":428,"line":457},[426,1347,666],{"class":1327},[426,1349,1350],{"class":436},"? } else { ?>\n",[426,1352,1353,1355,1358,1361,1363,1366],{"class":428,"line":473},[426,1354,684],{"class":436},[426,1356,1357],{"class":654},"form",[426,1359,1360],{"class":466}," method",[426,1362,674],{"class":436},[426,1364,1365],{"class":443},"\"POST\"",[426,1367,661],{"class":436},[426,1369,1370,1372,1375,1377,1379,1382,1385,1387],{"class":428,"line":479},[426,1371,694],{"class":436},[426,1373,1374],{"class":654},"button",[426,1376,797],{"class":466},[426,1378,674],{"class":436},[426,1380,1381],{"class":443},"\"submit\"",[426,1383,1384],{"class":436},">Submit\u003C/",[426,1386,1374],{"class":654},[426,1388,661],{"class":436},[426,1390,1391,1393,1395],{"class":428,"line":495},[426,1392,751],{"class":436},[426,1394,1357],{"class":654},[426,1396,661],{"class":436},[426,1398,1399,1401],{"class":428,"line":509},[426,1400,666],{"class":1327},[426,1402,1403],{"class":436},"? } ?>\n",[426,1405,1406],{"class":428,"line":525},[426,1407,454],{"emptyLinePlaceholder":453},[426,1409,1410,1412,1414],{"class":428,"line":531},[426,1411,666],{"class":436},[426,1413,919],{"class":654},[426,1415,661],{"class":436},[426,1417,1418,1420],{"class":428,"line":789},[426,1419,666],{"class":1327},[426,1421,1422],{"class":436},"? for (const item of ['a', 'b', 'c']) { ?>\n",[426,1424,1425,1427,1429,1432,1434],{"class":428,"line":819},[426,1426,684],{"class":436},[426,1428,922],{"class":654},[426,1430,1431],{"class":436},">{{ item }}\u003C/",[426,1433,922],{"class":654},[426,1435,661],{"class":436},[426,1437,1438,1440],{"class":428,"line":828},[426,1439,666],{"class":1327},[426,1441,1403],{"class":436},[426,1443,1445,1447,1449],{"class":428,"line":1444},13,[426,1446,831],{"class":436},[426,1448,919],{"class":654},[426,1450,661],{"class":436},[1242,1452,1454],{"id":1453},"server-scripts","Server scripts",[401,1456,1313,1457,1460],{},[412,1458,1459],{},"\u003Cscript server>"," to execute JavaScript on the server:",[417,1462,1464],{"className":642,"code":1463,"language":644,"meta":5,"style":5},"\u003Cscript server>\n  const data = await fetch('https://api.example.com/data').then(r => r.json());\n\u003C/script>\n\u003Cpre>{{ JSON.stringify(data) }}\u003C/pre>\n",[412,1465,1466,1477,1522,1530],{"__ignoreMap":5},[426,1467,1468,1470,1472,1475],{"class":428,"line":429},[426,1469,666],{"class":436},[426,1471,794],{"class":654},[426,1473,1474],{"class":466}," server",[426,1476,661],{"class":436},[426,1478,1479,1482,1485,1488,1491,1494,1497,1500,1502,1505,1507,1510,1513,1516,1519],{"class":428,"line":450},[426,1480,1481],{"class":432},"  const",[426,1483,1484],{"class":515}," data",[426,1486,1487],{"class":432}," =",[426,1489,1490],{"class":432}," await",[426,1492,1493],{"class":466}," fetch",[426,1495,1496],{"class":436},"(",[426,1498,1499],{"class":443},"'https://api.example.com/data'",[426,1501,616],{"class":436},[426,1503,1504],{"class":466},"then",[426,1506,1496],{"class":436},[426,1508,1509],{"class":874},"r",[426,1511,1512],{"class":432}," =>",[426,1514,1515],{"class":436}," r.",[426,1517,1518],{"class":466},"json",[426,1520,1521],{"class":436},"());\n",[426,1523,1524,1526,1528],{"class":428,"line":457},[426,1525,831],{"class":436},[426,1527,794],{"class":654},[426,1529,661],{"class":436},[426,1531,1532,1534,1536,1539,1541],{"class":428,"line":473},[426,1533,666],{"class":436},[426,1535,417],{"class":654},[426,1537,1538],{"class":436},">{{ JSON.stringify(data) }}\u003C/",[426,1540,417],{"class":654},[426,1542,661],{"class":436},[1242,1544,1546],{"id":1545},"streaming-content","Streaming content",[401,1548,1549,1550,1553],{},"Use the ",[412,1551,1552],{},"echo()"," function for streaming content. It accepts strings, functions, Promises, Response objects, or ReadableStreams:",[417,1555,1557],{"className":642,"code":1556,"language":644,"meta":5,"style":5},"\u003Cscript server>\n  echo(\"Loading...\");\n  echo(async () => fetch(\"https://api.example.com/data\"));\n\u003C/script>\n",[412,1558,1559,1569,1582,1606],{"__ignoreMap":5},[426,1560,1561,1563,1565,1567],{"class":428,"line":429},[426,1562,666],{"class":436},[426,1564,794],{"class":654},[426,1566,1474],{"class":466},[426,1568,661],{"class":436},[426,1570,1571,1574,1576,1579],{"class":428,"line":450},[426,1572,1573],{"class":466},"  echo",[426,1575,1496],{"class":436},[426,1577,1578],{"class":443},"\"Loading...\"",[426,1580,1581],{"class":436},");\n",[426,1583,1584,1586,1588,1591,1594,1596,1598,1600,1603],{"class":428,"line":457},[426,1585,1573],{"class":466},[426,1587,1496],{"class":436},[426,1589,1590],{"class":432},"async",[426,1592,1593],{"class":436}," () ",[426,1595,881],{"class":432},[426,1597,1493],{"class":466},[426,1599,1496],{"class":436},[426,1601,1602],{"class":443},"\"https://api.example.com/data\"",[426,1604,1605],{"class":436},"));\n",[426,1607,1608,1610,1612],{"class":428,"line":473},[426,1609,831],{"class":436},[426,1611,794],{"class":654},[426,1613,661],{"class":436},[1242,1615,1617],{"id":1616},"global-variables","Global variables",[401,1619,1620],{},"Access request context within templates:",[536,1622,1623,1632],{},[539,1624,1625],{},[542,1626,1627,1630],{},[545,1628,1629],{},"Variable",[545,1631,553],{},[555,1633,1634,1648,1665,1678,1688,1698],{},[542,1635,1636,1641],{},[560,1637,1638],{},[412,1639,1640],{},"$REQUEST",[560,1642,1643,1644,1647],{},"The incoming ",[412,1645,1646],{},"Request"," object",[542,1649,1650,1655],{},[560,1651,1652],{},[412,1653,1654],{},"$METHOD",[560,1656,1657,1658,933,1661,1664],{},"HTTP method (",[412,1659,1660],{},"GET",[412,1662,1663],{},"POST",", etc.)",[542,1666,1667,1672],{},[560,1668,1669],{},[412,1670,1671],{},"$URL",[560,1673,1674,1675,1647],{},"Request ",[412,1676,1677],{},"URL",[542,1679,1680,1685],{},[560,1681,1682],{},[412,1683,1684],{},"$HEADERS",[560,1686,1687],{},"Request headers",[542,1689,1690,1695],{},[560,1691,1692],{},[412,1693,1694],{},"$RESPONSE",[560,1696,1697],{},"Response configuration object",[542,1699,1700,1705],{},[560,1701,1702],{},[412,1703,1704],{},"$COOKIES",[560,1706,1707],{},"Read-only object containing request cookies",[1242,1709,1711],{"id":1710},"built-in-functions","Built-in functions",[536,1713,1714,1723],{},[539,1715,1716],{},[542,1717,1718,1721],{},[545,1719,1720],{},"Function",[545,1722,553],{},[555,1724,1725,1739,1749,1759],{},[542,1726,1727,1732],{},[560,1728,1729],{},[412,1730,1731],{},"htmlspecialchars(str)",[560,1733,1734,1735,1738],{},"Escape HTML characters (automatically applied in ",[412,1736,1737],{},"{{ }}"," syntax)",[542,1740,1741,1746],{},[560,1742,1743],{},[412,1744,1745],{},"setCookie(name, value, options?)",[560,1747,1748],{},"Set a cookie in the response",[542,1750,1751,1756],{},[560,1752,1753],{},[412,1754,1755],{},"redirect(url)",[560,1757,1758],{},"Redirect the user to another URL",[542,1760,1761,1766],{},[560,1762,1763],{},[412,1764,1765],{},"echo(content)",[560,1767,1768],{},"Stream content to the response",[417,1770,1772],{"className":642,"code":1771,"filename":615,"language":644,"meta":5,"style":5},"\u003C!DOCTYPE html>\n\u003Chtml lang=\"en\">\n  \u003Chead>\n    \u003Cmeta charset=\"UTF-8\" />\n    \u003Ctitle>Dynamic template\u003C/title>\n  \u003C/head>\n  \u003Cbody>\n    \u003Ch1>Hello {{ $REQUEST.url }}\u003C/h1>\n    \u003Cp>Welcome, \u003C?= $COOKIES[\"user\"] || \"Guest\" ?>!\u003C/p>\n    \u003Cscript server>\n      setCookie(\"visited\", \"true\", { maxAge: 3600 });\n    \u003C/script>\n  \u003C/body>\n\u003C/html>\n",[412,1773,1774,1784,1798,1806,1820,1833,1841,1849,1862,1880,1890,1914,1923,1931],{"__ignoreMap":5},[426,1775,1776,1778,1780,1782],{"class":428,"line":429},[426,1777,651],{"class":436},[426,1779,655],{"class":654},[426,1781,658],{"class":466},[426,1783,661],{"class":436},[426,1785,1786,1788,1790,1792,1794,1796],{"class":428,"line":450},[426,1787,666],{"class":436},[426,1789,644],{"class":654},[426,1791,671],{"class":466},[426,1793,674],{"class":436},[426,1795,677],{"class":443},[426,1797,661],{"class":436},[426,1799,1800,1802,1804],{"class":428,"line":457},[426,1801,684],{"class":436},[426,1803,687],{"class":654},[426,1805,661],{"class":436},[426,1807,1808,1810,1812,1814,1816,1818],{"class":428,"line":473},[426,1809,694],{"class":436},[426,1811,697],{"class":654},[426,1813,700],{"class":466},[426,1815,674],{"class":436},[426,1817,705],{"class":443},[426,1819,708],{"class":436},[426,1821,1822,1824,1826,1829,1831],{"class":428,"line":479},[426,1823,694],{"class":436},[426,1825,739],{"class":654},[426,1827,1828],{"class":436},">Dynamic template\u003C/",[426,1830,739],{"class":654},[426,1832,661],{"class":436},[426,1834,1835,1837,1839],{"class":428,"line":495},[426,1836,751],{"class":436},[426,1838,687],{"class":654},[426,1840,661],{"class":436},[426,1842,1843,1845,1847],{"class":428,"line":509},[426,1844,684],{"class":436},[426,1846,762],{"class":654},[426,1848,661],{"class":436},[426,1850,1851,1853,1855,1858,1860],{"class":428,"line":525},[426,1852,694],{"class":436},[426,1854,1275],{"class":654},[426,1856,1857],{"class":436},">Hello {{ $REQUEST.url }}\u003C/",[426,1859,1275],{"class":654},[426,1861,661],{"class":436},[426,1863,1864,1866,1868,1871,1873,1876,1878],{"class":428,"line":531},[426,1865,694],{"class":436},[426,1867,401],{"class":654},[426,1869,1870],{"class":436},">Welcome, ",[426,1872,666],{"class":1327},[426,1874,1875],{"class":436},"?= $COOKIES[\"user\"] || \"Guest\" ?>!\u003C/",[426,1877,401],{"class":654},[426,1879,661],{"class":436},[426,1881,1882,1884,1886,1888],{"class":428,"line":789},[426,1883,694],{"class":436},[426,1885,794],{"class":654},[426,1887,1474],{"class":466},[426,1889,661],{"class":436},[426,1891,1892,1895,1897,1900,1902,1905,1908,1911],{"class":428,"line":819},[426,1893,1894],{"class":466},"      setCookie",[426,1896,1496],{"class":436},[426,1898,1899],{"class":443},"\"visited\"",[426,1901,933],{"class":436},[426,1903,1904],{"class":443},"\"true\"",[426,1906,1907],{"class":436},", { maxAge: ",[426,1909,1910],{"class":515},"3600",[426,1912,1913],{"class":436}," });\n",[426,1915,1916,1919,1921],{"class":428,"line":828},[426,1917,1918],{"class":436},"    \u003C/",[426,1920,794],{"class":654},[426,1922,661],{"class":436},[426,1924,1925,1927,1929],{"class":428,"line":1444},[426,1926,751],{"class":436},[426,1928,762],{"class":654},[426,1930,661],{"class":436},[426,1932,1934,1936,1938],{"class":428,"line":1933},14,[426,1935,831],{"class":436},[426,1937,644],{"class":654},[426,1939,661],{"class":436},[1941,1942],"read-more",{"title":1943,"to":1237},"Rendu Documentation",[405,1945,1947],{"id":1946},"custom-renderer-handler","Custom renderer handler",[401,1949,1950],{},"For more complex scenarios, you can create a custom renderer handler that programmatically generates responses.",[401,1952,1953,1954,1956,1957,1960],{},"The handler is a default export function that receives an H3 event object. You can access the incoming ",[412,1955,1646],{}," via ",[412,1958,1959],{},"event.req",":",[417,1962,1965],{"className":419,"code":1963,"filename":1964,"language":422,"meta":5,"style":5},"export default function renderer({ req }: { req: Request }) {\n  const url = new URL(req.url);\n  return new Response(\n    /* html */ `\u003C!DOCTYPE html>\n    \u003Chtml>\n    \u003Chead>\n      \u003Ctitle>Custom Renderer\u003C/title>\n    \u003C/head>\n    \u003Cbody>\n      \u003Ch1>Hello from custom renderer!\u003C/h1>\n      \u003Cp>Current path: ${url.pathname}\u003C/p>\n    \u003C/body>\n    \u003C/html>`,\n    { headers: { \"content-type\": \"text/html; charset=utf-8\" } }\n  );\n}\n","renderer.ts",[412,1966,1967,2003,2021,2033,2041,2046,2051,2056,2061,2066,2071,2088,2093,2100,2117,2123],{"__ignoreMap":5},[426,1968,1969,1971,1973,1976,1979,1982,1985,1988,1990,1993,1995,1997,2000],{"class":428,"line":429},[426,1970,460],{"class":432},[426,1972,463],{"class":432},[426,1974,1975],{"class":432}," function",[426,1977,1978],{"class":466}," renderer",[426,1980,1981],{"class":436},"({ ",[426,1983,1984],{"class":874},"req",[426,1986,1987],{"class":436}," }",[426,1989,1960],{"class":432},[426,1991,1992],{"class":436}," { ",[426,1994,1984],{"class":874},[426,1996,1960],{"class":432},[426,1998,1999],{"class":466}," Request",[426,2001,2002],{"class":436}," }) {\n",[426,2004,2005,2007,2010,2012,2015,2018],{"class":428,"line":450},[426,2006,1481],{"class":432},[426,2008,2009],{"class":515}," url",[426,2011,1487],{"class":432},[426,2013,2014],{"class":432}," new",[426,2016,2017],{"class":466}," URL",[426,2019,2020],{"class":436},"(req.url);\n",[426,2022,2023,2025,2027,2030],{"class":428,"line":457},[426,2024,889],{"class":432},[426,2026,2014],{"class":432},[426,2028,2029],{"class":466}," Response",[426,2031,2032],{"class":436},"(\n",[426,2034,2035,2038],{"class":428,"line":473},[426,2036,2037],{"class":491},"    /* html */",[426,2039,2040],{"class":443}," `\u003C!DOCTYPE html>\n",[426,2042,2043],{"class":428,"line":479},[426,2044,2045],{"class":443},"    \u003Chtml>\n",[426,2047,2048],{"class":428,"line":495},[426,2049,2050],{"class":443},"    \u003Chead>\n",[426,2052,2053],{"class":428,"line":509},[426,2054,2055],{"class":443},"      \u003Ctitle>Custom Renderer\u003C/title>\n",[426,2057,2058],{"class":428,"line":525},[426,2059,2060],{"class":443},"    \u003C/head>\n",[426,2062,2063],{"class":428,"line":531},[426,2064,2065],{"class":443},"    \u003Cbody>\n",[426,2067,2068],{"class":428,"line":789},[426,2069,2070],{"class":443},"      \u003Ch1>Hello from custom renderer!\u003C/h1>\n",[426,2072,2073,2076,2079,2082,2085],{"class":428,"line":819},[426,2074,2075],{"class":443},"      \u003Cp>Current path: ${",[426,2077,2078],{"class":436},"url",[426,2080,2081],{"class":443},".",[426,2083,2084],{"class":436},"pathname",[426,2086,2087],{"class":443},"}\u003C/p>\n",[426,2089,2090],{"class":428,"line":828},[426,2091,2092],{"class":443},"    \u003C/body>\n",[426,2094,2095,2098],{"class":428,"line":1444},[426,2096,2097],{"class":443},"    \u003C/html>`",[426,2099,1207],{"class":436},[426,2101,2102,2105,2108,2111,2114],{"class":428,"line":1933},[426,2103,2104],{"class":436},"    { headers: { ",[426,2106,2107],{"class":443},"\"content-type\"",[426,2109,2110],{"class":436},": ",[426,2112,2113],{"class":443},"\"text/html; charset=utf-8\"",[426,2115,2116],{"class":436}," } }\n",[426,2118,2120],{"class":428,"line":2119},15,[426,2121,2122],{"class":436},"  );\n",[426,2124,2126],{"class":428,"line":2125},16,[426,2127,2128],{"class":436},"}\n",[401,2130,2131],{},"Then, specify the renderer entry in the Nitro config:",[417,2133,2135],{"className":419,"code":2134,"filename":421,"language":422,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  renderer: {\n    handler: './renderer.ts'\n  }\n})\n",[412,2136,2137,2149,2153,2163,2167,2174,2178],{"__ignoreMap":5},[426,2138,2139,2141,2143,2145,2147],{"class":428,"line":429},[426,2140,433],{"class":432},[426,2142,437],{"class":436},[426,2144,440],{"class":432},[426,2146,444],{"class":443},[426,2148,447],{"class":436},[426,2150,2151],{"class":428,"line":450},[426,2152,454],{"emptyLinePlaceholder":453},[426,2154,2155,2157,2159,2161],{"class":428,"line":457},[426,2156,460],{"class":432},[426,2158,463],{"class":432},[426,2160,467],{"class":466},[426,2162,470],{"class":436},[426,2164,2165],{"class":428,"line":473},[426,2166,476],{"class":436},[426,2168,2169,2171],{"class":428,"line":479},[426,2170,498],{"class":436},[426,2172,2173],{"class":443},"'./renderer.ts'\n",[426,2175,2176],{"class":428,"line":495},[426,2177,528],{"class":436},[426,2179,2180],{"class":428,"line":509},[426,2181,534],{"class":436},[2183,2184,2185],"note",{},[401,2186,601,2187,2190,2191,2193],{},[412,2188,2189],{},"renderer.handler"," is set, it takes full control of rendering. The ",[412,2192,949],{}," option is ignored.",[405,2195,2197],{"id":2196},"renderer-priority","Renderer priority",[401,2199,2200,2201,2204,2205,2208],{},"The renderer always acts as a catch-all route (",[412,2202,2203],{},"/**",") and has the ",[1294,2206,2207],{},"lowest priority",". This means:",[2210,2211,2213,2220,2225],"steps",{"level":2212},"4",[1242,2214,2215,2216,2219],{},"Specific API routes are matched first (e.g., ",[412,2217,2218],{},"/api/users",")",[1242,2221,2222,2223,2219],{},"Specific server routes are matched next (e.g., ",[412,2224,932],{},[1242,2226,2227],{},"The renderer catches everything else",[417,2229,2233],{"className":2230,"code":2231,"language":2232,"meta":5,"style":5},"language-md shiki shiki-themes github-light github-dark github-dark","api/\n  users.ts        → /api/users (matched first)\nroutes/\n  about.ts        → /about (matched second)\nrenderer.ts         → /** (catches all other routes)\n","md",[412,2234,2235,2240,2245,2250,2255],{"__ignoreMap":5},[426,2236,2237],{"class":428,"line":429},[426,2238,2239],{"class":436},"api/\n",[426,2241,2242],{"class":428,"line":450},[426,2243,2244],{"class":436},"  users.ts        → /api/users (matched first)\n",[426,2246,2247],{"class":428,"line":457},[426,2248,2249],{"class":436},"routes/\n",[426,2251,2252],{"class":428,"line":473},[426,2253,2254],{"class":436},"  about.ts        → /about (matched second)\n",[426,2256,2257],{"class":428,"line":479},[426,2258,2259],{"class":436},"renderer.ts         → /** (catches all other routes)\n",[2261,2262,2263],"warning",{},[401,2264,2265,2266,2269],{},"If you define a catch-all route (",[412,2267,2268],{},"[...].ts",") in your routes, Nitro will warn you that the renderer will override it. Use more specific routes or different HTTP methods to avoid conflicts.",[1941,2271],{"title":43,"to":44},[405,2273,2275],{"id":2274},"vite-integration","Vite integration",[401,2277,2278],{},"When using Nitro with Vite, the renderer integrates with Vite's build pipeline and dev server.",[622,2280,2282],{"id":2281},"development-mode","Development mode",[401,2284,2285,2286,2288,2289,2292],{},"In development, the renderer template is read from disk on each request, so changes to ",[412,2287,615],{}," are reflected immediately without restarting the server. Vite's ",[412,2290,2291],{},"transformIndexHtml"," hook is applied to inject HMR client scripts and other dev-time transforms.",[622,2294,2296,2297],{"id":2295},"ssr-with-ssr-outlet","SSR with ",[412,2298,2299],{},"\u003C!--ssr-outlet-->",[401,2301,2302,2303,2306,2307,2309,2310,2312],{},"When using Vite environments with an ",[412,2304,2305],{},"ssr"," service, you can add an ",[412,2308,2299],{}," comment to your ",[412,2311,615],{},". Nitro will replace it with the output from your SSR entry during rendering:",[417,2314,2316],{"className":642,"code":2315,"filename":615,"language":644,"meta":5,"style":5},"\u003C!DOCTYPE html>\n\u003Chtml lang=\"en\">\n  \u003Chead>\n    \u003Cmeta charset=\"UTF-8\" />\n    \u003Ctitle>SSR App\u003C/title>\n  \u003C/head>\n  \u003Cbody>\n    \u003Cdiv id=\"app\">\u003C!--ssr-outlet-->\u003C/div>\n    \u003Cscript type=\"module\" src=\"/src/main.ts\">\u003C/script>\n  \u003C/body>\n\u003C/html>\n",[412,2317,2318,2328,2342,2350,2364,2377,2385,2393,2416,2440,2448],{"__ignoreMap":5},[426,2319,2320,2322,2324,2326],{"class":428,"line":429},[426,2321,651],{"class":436},[426,2323,655],{"class":654},[426,2325,658],{"class":466},[426,2327,661],{"class":436},[426,2329,2330,2332,2334,2336,2338,2340],{"class":428,"line":450},[426,2331,666],{"class":436},[426,2333,644],{"class":654},[426,2335,671],{"class":466},[426,2337,674],{"class":436},[426,2339,677],{"class":443},[426,2341,661],{"class":436},[426,2343,2344,2346,2348],{"class":428,"line":457},[426,2345,684],{"class":436},[426,2347,687],{"class":654},[426,2349,661],{"class":436},[426,2351,2352,2354,2356,2358,2360,2362],{"class":428,"line":473},[426,2353,694],{"class":436},[426,2355,697],{"class":654},[426,2357,700],{"class":466},[426,2359,674],{"class":436},[426,2361,705],{"class":443},[426,2363,708],{"class":436},[426,2365,2366,2368,2370,2373,2375],{"class":428,"line":479},[426,2367,694],{"class":436},[426,2369,739],{"class":654},[426,2371,2372],{"class":436},">SSR App\u003C/",[426,2374,739],{"class":654},[426,2376,661],{"class":436},[426,2378,2379,2381,2383],{"class":428,"line":495},[426,2380,751],{"class":436},[426,2382,687],{"class":654},[426,2384,661],{"class":436},[426,2386,2387,2389,2391],{"class":428,"line":509},[426,2388,684],{"class":436},[426,2390,762],{"class":654},[426,2392,661],{"class":436},[426,2394,2395,2397,2399,2401,2403,2405,2408,2410,2412,2414],{"class":428,"line":525},[426,2396,694],{"class":436},[426,2398,771],{"class":654},[426,2400,774],{"class":466},[426,2402,674],{"class":436},[426,2404,779],{"class":443},[426,2406,2407],{"class":436},">",[426,2409,2299],{"class":491},[426,2411,831],{"class":436},[426,2413,771],{"class":654},[426,2415,661],{"class":436},[426,2417,2418,2420,2422,2424,2426,2428,2430,2432,2434,2436,2438],{"class":428,"line":531},[426,2419,694],{"class":436},[426,2421,794],{"class":654},[426,2423,797],{"class":466},[426,2425,674],{"class":436},[426,2427,802],{"class":443},[426,2429,805],{"class":466},[426,2431,674],{"class":436},[426,2433,810],{"class":443},[426,2435,782],{"class":436},[426,2437,794],{"class":654},[426,2439,661],{"class":436},[426,2441,2442,2444,2446],{"class":428,"line":789},[426,2443,751],{"class":436},[426,2445,762],{"class":654},[426,2447,661],{"class":436},[426,2449,2450,2452,2454],{"class":428,"line":819},[426,2451,831],{"class":436},[426,2453,644],{"class":654},[426,2455,661],{"class":436},[622,2457,2459],{"id":2458},"production-build","Production build",[401,2461,2462,2463,2465],{},"During production builds, Vite processes the ",[412,2464,615],{}," through its build pipeline (resolving scripts, CSS, and other assets), then Nitro inlines the transformed HTML into the server bundle.",[405,2467,2469],{"id":2468},"use-cases","Use Cases",[622,2471,2473],{"id":2472},"single-page-application-spa","Single-Page Application (SPA)",[401,2475,2476,2477,2479],{},"Serve your SPA's ",[412,2478,615],{}," for all routes to enable client-side routing:",[905,2481,2482],{},[401,2483,2484],{},"\nThis is the default behavior of Nitro when used with Vite.",[2486,2487,2488],"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 pre.shiki code .suiK_, html code.shiki .suiK_{--shiki-light:#005CC5;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}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 .sQHwn, html code.shiki .sQHwn{--shiki-light:#E36209;--shiki-default:#FFAB70;--shiki-dark:#FFAB70}html pre.shiki code .sByVh, html code.shiki .sByVh{--shiki-light:#22863A;--shiki-default:#85E89D;--shiki-dark:#85E89D}html pre.shiki code .sVAnh, html code.shiki .sVAnh{--shiki-light:#B31D28;--shiki-light-font-style:italic;--shiki-default:#FDAEB7;--shiki-default-font-style:italic;--shiki-dark:#FDAEB7;--shiki-dark-font-style:italic}",{"title":5,"searchDepth":450,"depth":450,"links":2490},[2491,2492,2499,2500,2501,2507],{"id":407,"depth":450,"text":33},{"id":619,"depth":450,"text":620,"children":2493},[2494,2496,2497,2498],{"id":624,"depth":457,"text":2495},"Auto-detected index.html",{"id":942,"depth":457,"text":943},{"id":1147,"depth":457,"text":1148},{"id":1230,"depth":457,"text":1231},{"id":1946,"depth":450,"text":1947},{"id":2196,"depth":450,"text":2197},{"id":2274,"depth":450,"text":2275,"children":2502},[2503,2504,2506],{"id":2281,"depth":457,"text":2282},{"id":2295,"depth":457,"text":2505},"SSR with \u003C!--ssr-outlet-->",{"id":2458,"depth":457,"text":2459},{"id":2468,"depth":450,"text":2469,"children":2508},[2509],{"id":2472,"depth":457,"text":2473},"Use a renderer to handle all unmatched routes with custom HTML or a templating system.",{"icon":21},{"title":18,"icon":21},{"title":396,"description":2510},"9CnfJzzu3bGZNPlHQcaLZyScF3UtDcaQpY_DGeAYFBY",[2516,2518],{"title":13,"path":14,"stem":15,"description":2517,"icon":16,"children":-1},"Start with a fresh Nitro project or adopt it in your current Vite project.",{"title":23,"path":24,"stem":25,"description":2519,"icon":26,"children":-1},"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.",1775834858588]