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