[{"data":1,"prerenderedAt":2514},["ShallowReactive",2],{"navigation":3,"-docs-renderer":389,"-docs-renderer-surround":2509},[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":2504,"extension":2226,"meta":2505,"navigation":2506,"path":19,"seo":2507,"stem":20,"__hash__":2508},"content/1.docs/4.renderer.md","Nitro Renderer",{"type":393,"value":394,"toc":2483,"icon":21},"minimark",[395,399,403,411,530,601,612,616,623,629,632,898,909,912,934,938,945,1139,1143,1152,1158,1219,1222,1226,1235,1240,1258,1301,1305,1312,1445,1449,1455,1537,1541,1548,1608,1612,1615,1702,1706,1763,1934,1938,1942,1945,1955,2123,2126,2176,2188,2192,2203,2222,2254,2264,2266,2270,2273,2277,2287,2294,2307,2450,2454,2460,2464,2468,2474,2479],[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 { defineConfig } from \"nitro\";\n\nexport default defineConfig({\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"," { defineConfig } ",[421,434,435],{"class":427},"from",[421,437,439],{"class":438},"sfrk1"," \"nitro\"",[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"," defineConfig",[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,850,854,879,893],{"__ignoreMap":5},[421,838,839,841,844,846,848],{"class":423,"line":424},[421,840,428],{"class":427},[421,842,843],{"class":431}," { defineHandler } ",[421,845,435],{"class":427},[421,847,439],{"class":438},[421,849,442],{"class":431},[421,851,852],{"class":423,"line":445},[421,853,449],{"emptyLinePlaceholder":448},[421,855,856,858,860,863,866,870,873,876],{"class":423,"line":452},[421,857,455],{"class":427},[421,859,458],{"class":427},[421,861,862],{"class":461}," defineHandler",[421,864,865],{"class":431},"((",[421,867,869],{"class":868},"sQHwn","event",[421,871,872],{"class":431},") ",[421,874,875],{"class":427},"=>",[421,877,878],{"class":431}," {\n",[421,880,881,884,887,890],{"class":423,"line":468},[421,882,883],{"class":427},"  return",[421,885,886],{"class":431}," { hello: ",[421,888,889],{"class":438},"\"API\"",[421,891,892],{"class":431}," };\n",[421,894,895],{"class":423,"line":474},[421,896,897],{"class":431},"});\n",[899,900,901],"tip",{},[396,902,596,903,905,906],{},[407,904,610],{}," is detected, Nitro will automatically log in the terminal: ",[407,907,908],{},"Using index.html as renderer template.",[396,910,911],{},"With this setup:",[913,914,915,922],"ul",{},[916,917,918,921],"li",{},[407,919,920],{},"/api/hello"," → Handled by your API routes",[916,923,924,927,928,931,932],{},[407,925,926],{},"/about",", ",[407,929,930],{},"/contact",", etc. → Served with ",[407,933,610],{},[617,935,937],{"id":936},"custom-html-file","Custom HTML file",[396,939,940,941,944],{},"You can specify a custom HTML template file using the ",[407,942,943],{},"renderer.template"," option in your Nitro configuration.",[633,946,947,997],{},[412,948,950],{"className":414,"code":949,"filename":416,"language":417,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  renderer: {\n    template: './app.html'\n  }\n})\n",[407,951,952,964,968,978,982,989,993],{"__ignoreMap":5},[421,953,954,956,958,960,962],{"class":423,"line":424},[421,955,428],{"class":427},[421,957,432],{"class":431},[421,959,435],{"class":427},[421,961,439],{"class":438},[421,963,442],{"class":431},[421,965,966],{"class":423,"line":445},[421,967,449],{"emptyLinePlaceholder":448},[421,969,970,972,974,976],{"class":423,"line":452},[421,971,455],{"class":427},[421,973,458],{"class":427},[421,975,462],{"class":461},[421,977,465],{"class":431},[421,979,980],{"class":423,"line":468},[421,981,471],{"class":431},[421,983,984,986],{"class":423,"line":474},[421,985,477],{"class":431},[421,987,988],{"class":438},"'./app.html'\n",[421,990,991],{"class":423,"line":490},[421,992,523],{"class":431},[421,994,995],{"class":423,"line":504},[421,996,529],{"class":431},[412,998,1001],{"className":637,"code":999,"filename":1000,"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,1002,1003,1013,1027,1035,1049,1062,1070,1078,1098,1123,1131],{"__ignoreMap":5},[421,1004,1005,1007,1009,1011],{"class":423,"line":424},[421,1006,646],{"class":431},[421,1008,650],{"class":649},[421,1010,653],{"class":461},[421,1012,656],{"class":431},[421,1014,1015,1017,1019,1021,1023,1025],{"class":423,"line":445},[421,1016,661],{"class":431},[421,1018,639],{"class":649},[421,1020,666],{"class":461},[421,1022,669],{"class":431},[421,1024,672],{"class":438},[421,1026,656],{"class":431},[421,1028,1029,1031,1033],{"class":423,"line":452},[421,1030,679],{"class":431},[421,1032,682],{"class":649},[421,1034,656],{"class":431},[421,1036,1037,1039,1041,1043,1045,1047],{"class":423,"line":468},[421,1038,689],{"class":431},[421,1040,692],{"class":649},[421,1042,695],{"class":461},[421,1044,669],{"class":431},[421,1046,700],{"class":438},[421,1048,703],{"class":431},[421,1050,1051,1053,1055,1058,1060],{"class":423,"line":474},[421,1052,689],{"class":431},[421,1054,734],{"class":649},[421,1056,1057],{"class":431},">Custom Template\u003C/",[421,1059,734],{"class":649},[421,1061,656],{"class":431},[421,1063,1064,1066,1068],{"class":423,"line":490},[421,1065,746],{"class":431},[421,1067,682],{"class":649},[421,1069,656],{"class":431},[421,1071,1072,1074,1076],{"class":423,"line":504},[421,1073,679],{"class":431},[421,1075,757],{"class":649},[421,1077,656],{"class":431},[421,1079,1080,1082,1084,1086,1088,1091,1094,1096],{"class":423,"line":520},[421,1081,689],{"class":431},[421,1083,766],{"class":649},[421,1085,769],{"class":461},[421,1087,669],{"class":431},[421,1089,1090],{"class":438},"\"root\"",[421,1092,1093],{"class":431},">Loading...\u003C/",[421,1095,766],{"class":649},[421,1097,656],{"class":431},[421,1099,1100,1102,1104,1106,1108,1110,1112,1114,1117,1119,1121],{"class":423,"line":526},[421,1101,689],{"class":431},[421,1103,789],{"class":649},[421,1105,792],{"class":461},[421,1107,669],{"class":431},[421,1109,797],{"class":438},[421,1111,800],{"class":461},[421,1113,669],{"class":431},[421,1115,1116],{"class":438},"\"/src/main.js\"",[421,1118,777],{"class":431},[421,1120,789],{"class":649},[421,1122,656],{"class":431},[421,1124,1125,1127,1129],{"class":423,"line":784},[421,1126,746],{"class":431},[421,1128,757],{"class":649},[421,1130,656],{"class":431},[421,1132,1133,1135,1137],{"class":423,"line":814},[421,1134,826],{"class":431},[421,1136,639],{"class":649},[421,1138,656],{"class":431},[617,1140,1142],{"id":1141},"static-templates","Static templates",[396,1144,1145,1146,1151],{},"By default, Nitro auto-detects whether your HTML template contains ",[1147,1148,1150],"a",{"href":1149},"#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,1153,1154,1155,1157],{},"You can override this behavior with the ",[407,1156,588],{}," option:",[412,1159,1161],{"className":414,"code":1160,"filename":416,"language":417,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  renderer: {\n    template: './index.html',\n    static: true // Force static serving, skip template processing\n  }\n})\n",[407,1162,1163,1175,1179,1189,1193,1202,1211,1215],{"__ignoreMap":5},[421,1164,1165,1167,1169,1171,1173],{"class":423,"line":424},[421,1166,428],{"class":427},[421,1168,432],{"class":431},[421,1170,435],{"class":427},[421,1172,439],{"class":438},[421,1174,442],{"class":431},[421,1176,1177],{"class":423,"line":445},[421,1178,449],{"emptyLinePlaceholder":448},[421,1180,1181,1183,1185,1187],{"class":423,"line":452},[421,1182,455],{"class":427},[421,1184,458],{"class":427},[421,1186,462],{"class":461},[421,1188,465],{"class":431},[421,1190,1191],{"class":423,"line":468},[421,1192,471],{"class":431},[421,1194,1195,1197,1199],{"class":423,"line":474},[421,1196,477],{"class":431},[421,1198,480],{"class":438},[421,1200,1201],{"class":431},",\n",[421,1203,1204,1206,1208],{"class":423,"line":490},[421,1205,507],{"class":431},[421,1207,599],{"class":510},[421,1209,1210],{"class":486}," // Force static serving, skip template processing\n",[421,1212,1213],{"class":423,"line":504},[421,1214,523],{"class":431},[421,1216,1217],{"class":423,"line":520},[421,1218,529],{"class":431},[396,1220,1221],{},"In production, static templates are inlined into the server bundle and served directly for optimal performance.",[617,1223,1225],{"id":1224},"hypertext-preprocessor-experimental","Hypertext Preprocessor (experimental)",[396,1227,1228,1229,1234],{},"Nitro uses ",[1147,1230,1150],{"href":1231,"rel":1232},"https://github.com/h3js/rendu",[1233],"nofollow"," Hypertext Preprocessor, which provides a simple and powerful way to create dynamic HTML templates with JavaScript expressions.",[1236,1237,1239],"h4",{"id":1238},"output-expressions","Output expressions",[913,1241,1242,1248],{},[916,1243,1244,1247],{},[407,1245,1246],{},"{{ expression }}"," — HTML-escaped output",[916,1249,1250,1253,1254,1257],{},[407,1251,1252],{},"{{{ expression }}}"," or ",[407,1255,1256],{},"\u003C?= expression ?>"," — raw (unescaped) output",[412,1259,1261],{"className":637,"code":1260,"language":639,"meta":5,"style":5},"\u003Ch1>Hello {{ $URL.pathname }}\u003C/h1>\n\u003Cdiv>{{{ '\u003Cstrong>raw html\u003C/strong>' }}}\u003C/div>\n",[407,1262,1263,1277],{"__ignoreMap":5},[421,1264,1265,1267,1270,1273,1275],{"class":423,"line":424},[421,1266,661],{"class":431},[421,1268,1269],{"class":649},"h1",[421,1271,1272],{"class":431},">Hello {{ $URL.pathname }}\u003C/",[421,1274,1269],{"class":649},[421,1276,656],{"class":431},[421,1278,1279,1281,1283,1286,1289,1292,1294,1297,1299],{"class":423,"line":445},[421,1280,661],{"class":431},[421,1282,766],{"class":649},[421,1284,1285],{"class":431},">{{{ '\u003C",[421,1287,1288],{"class":649},"strong",[421,1290,1291],{"class":431},">raw html\u003C/",[421,1293,1288],{"class":649},[421,1295,1296],{"class":431},">' }}}\u003C/",[421,1298,766],{"class":649},[421,1300,656],{"class":431},[1236,1302,1304],{"id":1303},"control-flow","Control flow",[396,1306,1307,1308,1311],{},"Use ",[407,1309,1310],{},"\u003C? ... ?>"," for JavaScript control flow:",[412,1313,1315],{"className":637,"code":1314,"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,1316,1317,1325,1338,1345,1362,1383,1391,1398,1402,1410,1417,1430,1436],{"__ignoreMap":5},[421,1318,1319,1322],{"class":423,"line":424},[421,1320,661],{"class":1321},"sVAnh",[421,1323,1324],{"class":431},"? if ($METHOD === 'POST') { ?>\n",[421,1326,1327,1329,1331,1334,1336],{"class":423,"line":445},[421,1328,679],{"class":431},[421,1330,396],{"class":649},[421,1332,1333],{"class":431},">Form submitted!\u003C/",[421,1335,396],{"class":649},[421,1337,656],{"class":431},[421,1339,1340,1342],{"class":423,"line":452},[421,1341,661],{"class":1321},[421,1343,1344],{"class":431},"? } else { ?>\n",[421,1346,1347,1349,1352,1355,1357,1360],{"class":423,"line":468},[421,1348,679],{"class":431},[421,1350,1351],{"class":649},"form",[421,1353,1354],{"class":461}," method",[421,1356,669],{"class":431},[421,1358,1359],{"class":438},"\"POST\"",[421,1361,656],{"class":431},[421,1363,1364,1366,1369,1371,1373,1376,1379,1381],{"class":423,"line":474},[421,1365,689],{"class":431},[421,1367,1368],{"class":649},"button",[421,1370,792],{"class":461},[421,1372,669],{"class":431},[421,1374,1375],{"class":438},"\"submit\"",[421,1377,1378],{"class":431},">Submit\u003C/",[421,1380,1368],{"class":649},[421,1382,656],{"class":431},[421,1384,1385,1387,1389],{"class":423,"line":490},[421,1386,746],{"class":431},[421,1388,1351],{"class":649},[421,1390,656],{"class":431},[421,1392,1393,1395],{"class":423,"line":504},[421,1394,661],{"class":1321},[421,1396,1397],{"class":431},"? } ?>\n",[421,1399,1400],{"class":423,"line":520},[421,1401,449],{"emptyLinePlaceholder":448},[421,1403,1404,1406,1408],{"class":423,"line":526},[421,1405,661],{"class":431},[421,1407,913],{"class":649},[421,1409,656],{"class":431},[421,1411,1412,1414],{"class":423,"line":784},[421,1413,661],{"class":1321},[421,1415,1416],{"class":431},"? for (const item of ['a', 'b', 'c']) { ?>\n",[421,1418,1419,1421,1423,1426,1428],{"class":423,"line":814},[421,1420,679],{"class":431},[421,1422,916],{"class":649},[421,1424,1425],{"class":431},">{{ item }}\u003C/",[421,1427,916],{"class":649},[421,1429,656],{"class":431},[421,1431,1432,1434],{"class":423,"line":823},[421,1433,661],{"class":1321},[421,1435,1397],{"class":431},[421,1437,1439,1441,1443],{"class":423,"line":1438},13,[421,1440,826],{"class":431},[421,1442,913],{"class":649},[421,1444,656],{"class":431},[1236,1446,1448],{"id":1447},"server-scripts","Server scripts",[396,1450,1307,1451,1454],{},[407,1452,1453],{},"\u003Cscript server>"," to execute JavaScript on the server:",[412,1456,1458],{"className":637,"code":1457,"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,1459,1460,1471,1516,1524],{"__ignoreMap":5},[421,1461,1462,1464,1466,1469],{"class":423,"line":424},[421,1463,661],{"class":431},[421,1465,789],{"class":649},[421,1467,1468],{"class":461}," server",[421,1470,656],{"class":431},[421,1472,1473,1476,1479,1482,1485,1488,1491,1494,1496,1499,1501,1504,1507,1510,1513],{"class":423,"line":445},[421,1474,1475],{"class":427},"  const",[421,1477,1478],{"class":510}," data",[421,1480,1481],{"class":427}," =",[421,1483,1484],{"class":427}," await",[421,1486,1487],{"class":461}," fetch",[421,1489,1490],{"class":431},"(",[421,1492,1493],{"class":438},"'https://api.example.com/data'",[421,1495,611],{"class":431},[421,1497,1498],{"class":461},"then",[421,1500,1490],{"class":431},[421,1502,1503],{"class":868},"r",[421,1505,1506],{"class":427}," =>",[421,1508,1509],{"class":431}," r.",[421,1511,1512],{"class":461},"json",[421,1514,1515],{"class":431},"());\n",[421,1517,1518,1520,1522],{"class":423,"line":452},[421,1519,826],{"class":431},[421,1521,789],{"class":649},[421,1523,656],{"class":431},[421,1525,1526,1528,1530,1533,1535],{"class":423,"line":468},[421,1527,661],{"class":431},[421,1529,412],{"class":649},[421,1531,1532],{"class":431},">{{ JSON.stringify(data) }}\u003C/",[421,1534,412],{"class":649},[421,1536,656],{"class":431},[1236,1538,1540],{"id":1539},"streaming-content","Streaming content",[396,1542,1543,1544,1547],{},"Use the ",[407,1545,1546],{},"echo()"," function for streaming content. It accepts strings, functions, Promises, Response objects, or ReadableStreams:",[412,1549,1551],{"className":637,"code":1550,"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,1552,1553,1563,1576,1600],{"__ignoreMap":5},[421,1554,1555,1557,1559,1561],{"class":423,"line":424},[421,1556,661],{"class":431},[421,1558,789],{"class":649},[421,1560,1468],{"class":461},[421,1562,656],{"class":431},[421,1564,1565,1568,1570,1573],{"class":423,"line":445},[421,1566,1567],{"class":461},"  echo",[421,1569,1490],{"class":431},[421,1571,1572],{"class":438},"\"Loading...\"",[421,1574,1575],{"class":431},");\n",[421,1577,1578,1580,1582,1585,1588,1590,1592,1594,1597],{"class":423,"line":452},[421,1579,1567],{"class":461},[421,1581,1490],{"class":431},[421,1583,1584],{"class":427},"async",[421,1586,1587],{"class":431}," () ",[421,1589,875],{"class":427},[421,1591,1487],{"class":461},[421,1593,1490],{"class":431},[421,1595,1596],{"class":438},"\"https://api.example.com/data\"",[421,1598,1599],{"class":431},"));\n",[421,1601,1602,1604,1606],{"class":423,"line":468},[421,1603,826],{"class":431},[421,1605,789],{"class":649},[421,1607,656],{"class":431},[1236,1609,1611],{"id":1610},"global-variables","Global variables",[396,1613,1614],{},"Access request context within templates:",[531,1616,1617,1626],{},[534,1618,1619],{},[537,1620,1621,1624],{},[540,1622,1623],{},"Variable",[540,1625,548],{},[550,1627,1628,1642,1659,1672,1682,1692],{},[537,1629,1630,1635],{},[555,1631,1632],{},[407,1633,1634],{},"$REQUEST",[555,1636,1637,1638,1641],{},"The incoming ",[407,1639,1640],{},"Request"," object",[537,1643,1644,1649],{},[555,1645,1646],{},[407,1647,1648],{},"$METHOD",[555,1650,1651,1652,927,1655,1658],{},"HTTP method (",[407,1653,1654],{},"GET",[407,1656,1657],{},"POST",", etc.)",[537,1660,1661,1666],{},[555,1662,1663],{},[407,1664,1665],{},"$URL",[555,1667,1668,1669,1641],{},"Request ",[407,1670,1671],{},"URL",[537,1673,1674,1679],{},[555,1675,1676],{},[407,1677,1678],{},"$HEADERS",[555,1680,1681],{},"Request headers",[537,1683,1684,1689],{},[555,1685,1686],{},[407,1687,1688],{},"$RESPONSE",[555,1690,1691],{},"Response configuration object",[537,1693,1694,1699],{},[555,1695,1696],{},[407,1697,1698],{},"$COOKIES",[555,1700,1701],{},"Read-only object containing request cookies",[1236,1703,1705],{"id":1704},"built-in-functions","Built-in functions",[531,1707,1708,1717],{},[534,1709,1710],{},[537,1711,1712,1715],{},[540,1713,1714],{},"Function",[540,1716,548],{},[550,1718,1719,1733,1743,1753],{},[537,1720,1721,1726],{},[555,1722,1723],{},[407,1724,1725],{},"htmlspecialchars(str)",[555,1727,1728,1729,1732],{},"Escape HTML characters (automatically applied in ",[407,1730,1731],{},"{{ }}"," syntax)",[537,1734,1735,1740],{},[555,1736,1737],{},[407,1738,1739],{},"setCookie(name, value, options?)",[555,1741,1742],{},"Set a cookie in the response",[537,1744,1745,1750],{},[555,1746,1747],{},[407,1748,1749],{},"redirect(url)",[555,1751,1752],{},"Redirect the user to another URL",[537,1754,1755,1760],{},[555,1756,1757],{},[407,1758,1759],{},"echo(content)",[555,1761,1762],{},"Stream content to the response",[412,1764,1766],{"className":637,"code":1765,"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,1767,1768,1778,1792,1800,1814,1827,1835,1843,1856,1874,1884,1908,1917,1925],{"__ignoreMap":5},[421,1769,1770,1772,1774,1776],{"class":423,"line":424},[421,1771,646],{"class":431},[421,1773,650],{"class":649},[421,1775,653],{"class":461},[421,1777,656],{"class":431},[421,1779,1780,1782,1784,1786,1788,1790],{"class":423,"line":445},[421,1781,661],{"class":431},[421,1783,639],{"class":649},[421,1785,666],{"class":461},[421,1787,669],{"class":431},[421,1789,672],{"class":438},[421,1791,656],{"class":431},[421,1793,1794,1796,1798],{"class":423,"line":452},[421,1795,679],{"class":431},[421,1797,682],{"class":649},[421,1799,656],{"class":431},[421,1801,1802,1804,1806,1808,1810,1812],{"class":423,"line":468},[421,1803,689],{"class":431},[421,1805,692],{"class":649},[421,1807,695],{"class":461},[421,1809,669],{"class":431},[421,1811,700],{"class":438},[421,1813,703],{"class":431},[421,1815,1816,1818,1820,1823,1825],{"class":423,"line":474},[421,1817,689],{"class":431},[421,1819,734],{"class":649},[421,1821,1822],{"class":431},">Dynamic template\u003C/",[421,1824,734],{"class":649},[421,1826,656],{"class":431},[421,1828,1829,1831,1833],{"class":423,"line":490},[421,1830,746],{"class":431},[421,1832,682],{"class":649},[421,1834,656],{"class":431},[421,1836,1837,1839,1841],{"class":423,"line":504},[421,1838,679],{"class":431},[421,1840,757],{"class":649},[421,1842,656],{"class":431},[421,1844,1845,1847,1849,1852,1854],{"class":423,"line":520},[421,1846,689],{"class":431},[421,1848,1269],{"class":649},[421,1850,1851],{"class":431},">Hello {{ $REQUEST.url }}\u003C/",[421,1853,1269],{"class":649},[421,1855,656],{"class":431},[421,1857,1858,1860,1862,1865,1867,1870,1872],{"class":423,"line":526},[421,1859,689],{"class":431},[421,1861,396],{"class":649},[421,1863,1864],{"class":431},">Welcome, ",[421,1866,661],{"class":1321},[421,1868,1869],{"class":431},"?= $COOKIES[\"user\"] || \"Guest\" ?>!\u003C/",[421,1871,396],{"class":649},[421,1873,656],{"class":431},[421,1875,1876,1878,1880,1882],{"class":423,"line":784},[421,1877,689],{"class":431},[421,1879,789],{"class":649},[421,1881,1468],{"class":461},[421,1883,656],{"class":431},[421,1885,1886,1889,1891,1894,1896,1899,1902,1905],{"class":423,"line":814},[421,1887,1888],{"class":461},"      setCookie",[421,1890,1490],{"class":431},[421,1892,1893],{"class":438},"\"visited\"",[421,1895,927],{"class":431},[421,1897,1898],{"class":438},"\"true\"",[421,1900,1901],{"class":431},", { maxAge: ",[421,1903,1904],{"class":510},"3600",[421,1906,1907],{"class":431}," });\n",[421,1909,1910,1913,1915],{"class":423,"line":823},[421,1911,1912],{"class":431},"    \u003C/",[421,1914,789],{"class":649},[421,1916,656],{"class":431},[421,1918,1919,1921,1923],{"class":423,"line":1438},[421,1920,746],{"class":431},[421,1922,757],{"class":649},[421,1924,656],{"class":431},[421,1926,1928,1930,1932],{"class":423,"line":1927},14,[421,1929,826],{"class":431},[421,1931,639],{"class":649},[421,1933,656],{"class":431},[1935,1936],"read-more",{"title":1937,"to":1231},"Rendu Documentation",[400,1939,1941],{"id":1940},"custom-renderer-handler","Custom renderer handler",[396,1943,1944],{},"For more complex scenarios, you can create a custom renderer handler that programmatically generates responses.",[396,1946,1947,1948,1950,1951,1954],{},"The handler is a default export function that receives an H3 event object. You can access the incoming ",[407,1949,1640],{}," via ",[407,1952,1953],{},"event.req",":",[412,1956,1959],{"className":414,"code":1957,"filename":1958,"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,1960,1961,1997,2015,2027,2035,2040,2045,2050,2055,2060,2065,2082,2087,2094,2111,2117],{"__ignoreMap":5},[421,1962,1963,1965,1967,1970,1973,1976,1979,1982,1984,1987,1989,1991,1994],{"class":423,"line":424},[421,1964,455],{"class":427},[421,1966,458],{"class":427},[421,1968,1969],{"class":427}," function",[421,1971,1972],{"class":461}," renderer",[421,1974,1975],{"class":431},"({ ",[421,1977,1978],{"class":868},"req",[421,1980,1981],{"class":431}," }",[421,1983,1954],{"class":427},[421,1985,1986],{"class":431}," { ",[421,1988,1978],{"class":868},[421,1990,1954],{"class":427},[421,1992,1993],{"class":461}," Request",[421,1995,1996],{"class":431}," }) {\n",[421,1998,1999,2001,2004,2006,2009,2012],{"class":423,"line":445},[421,2000,1475],{"class":427},[421,2002,2003],{"class":510}," url",[421,2005,1481],{"class":427},[421,2007,2008],{"class":427}," new",[421,2010,2011],{"class":461}," URL",[421,2013,2014],{"class":431},"(req.url);\n",[421,2016,2017,2019,2021,2024],{"class":423,"line":452},[421,2018,883],{"class":427},[421,2020,2008],{"class":427},[421,2022,2023],{"class":461}," Response",[421,2025,2026],{"class":431},"(\n",[421,2028,2029,2032],{"class":423,"line":468},[421,2030,2031],{"class":486},"    /* html */",[421,2033,2034],{"class":438}," `\u003C!DOCTYPE html>\n",[421,2036,2037],{"class":423,"line":474},[421,2038,2039],{"class":438},"    \u003Chtml>\n",[421,2041,2042],{"class":423,"line":490},[421,2043,2044],{"class":438},"    \u003Chead>\n",[421,2046,2047],{"class":423,"line":504},[421,2048,2049],{"class":438},"      \u003Ctitle>Custom Renderer\u003C/title>\n",[421,2051,2052],{"class":423,"line":520},[421,2053,2054],{"class":438},"    \u003C/head>\n",[421,2056,2057],{"class":423,"line":526},[421,2058,2059],{"class":438},"    \u003Cbody>\n",[421,2061,2062],{"class":423,"line":784},[421,2063,2064],{"class":438},"      \u003Ch1>Hello from custom renderer!\u003C/h1>\n",[421,2066,2067,2070,2073,2076,2079],{"class":423,"line":814},[421,2068,2069],{"class":438},"      \u003Cp>Current path: ${",[421,2071,2072],{"class":431},"url",[421,2074,2075],{"class":438},".",[421,2077,2078],{"class":431},"pathname",[421,2080,2081],{"class":438},"}\u003C/p>\n",[421,2083,2084],{"class":423,"line":823},[421,2085,2086],{"class":438},"    \u003C/body>\n",[421,2088,2089,2092],{"class":423,"line":1438},[421,2090,2091],{"class":438},"    \u003C/html>`",[421,2093,1201],{"class":431},[421,2095,2096,2099,2102,2105,2108],{"class":423,"line":1927},[421,2097,2098],{"class":431},"    { headers: { ",[421,2100,2101],{"class":438},"\"content-type\"",[421,2103,2104],{"class":431},": ",[421,2106,2107],{"class":438},"\"text/html; charset=utf-8\"",[421,2109,2110],{"class":431}," } }\n",[421,2112,2114],{"class":423,"line":2113},15,[421,2115,2116],{"class":431},"  );\n",[421,2118,2120],{"class":423,"line":2119},16,[421,2121,2122],{"class":431},"}\n",[396,2124,2125],{},"Then, specify the renderer entry in the Nitro config:",[412,2127,2129],{"className":414,"code":2128,"filename":416,"language":417,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  renderer: {\n    handler: './renderer.ts'\n  }\n})\n",[407,2130,2131,2143,2147,2157,2161,2168,2172],{"__ignoreMap":5},[421,2132,2133,2135,2137,2139,2141],{"class":423,"line":424},[421,2134,428],{"class":427},[421,2136,432],{"class":431},[421,2138,435],{"class":427},[421,2140,439],{"class":438},[421,2142,442],{"class":431},[421,2144,2145],{"class":423,"line":445},[421,2146,449],{"emptyLinePlaceholder":448},[421,2148,2149,2151,2153,2155],{"class":423,"line":452},[421,2150,455],{"class":427},[421,2152,458],{"class":427},[421,2154,462],{"class":461},[421,2156,465],{"class":431},[421,2158,2159],{"class":423,"line":468},[421,2160,471],{"class":431},[421,2162,2163,2165],{"class":423,"line":474},[421,2164,493],{"class":431},[421,2166,2167],{"class":438},"'./renderer.ts'\n",[421,2169,2170],{"class":423,"line":490},[421,2171,523],{"class":431},[421,2173,2174],{"class":423,"line":504},[421,2175,529],{"class":431},[2177,2178,2179],"note",{},[396,2180,596,2181,2184,2185,2187],{},[407,2182,2183],{},"renderer.handler"," is set, it takes full control of rendering. The ",[407,2186,943],{}," option is ignored.",[400,2189,2191],{"id":2190},"renderer-priority","Renderer priority",[396,2193,2194,2195,2198,2199,2202],{},"The renderer always acts as a catch-all route (",[407,2196,2197],{},"/**",") and has the ",[1288,2200,2201],{},"lowest priority",". This means:",[2204,2205,2207,2214,2219],"steps",{"level":2206},"4",[1236,2208,2209,2210,2213],{},"Specific API routes are matched first (e.g., ",[407,2211,2212],{},"/api/users",")",[1236,2215,2216,2217,2213],{},"Specific server routes are matched next (e.g., ",[407,2218,926],{},[1236,2220,2221],{},"The renderer catches everything else",[412,2223,2227],{"className":2224,"code":2225,"language":2226,"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,2228,2229,2234,2239,2244,2249],{"__ignoreMap":5},[421,2230,2231],{"class":423,"line":424},[421,2232,2233],{"class":431},"api/\n",[421,2235,2236],{"class":423,"line":445},[421,2237,2238],{"class":431},"  users.ts        → /api/users (matched first)\n",[421,2240,2241],{"class":423,"line":452},[421,2242,2243],{"class":431},"routes/\n",[421,2245,2246],{"class":423,"line":468},[421,2247,2248],{"class":431},"  about.ts        → /about (matched second)\n",[421,2250,2251],{"class":423,"line":474},[421,2252,2253],{"class":431},"renderer.ts         → /** (catches all other routes)\n",[2255,2256,2257],"warning",{},[396,2258,2259,2260,2263],{},"If you define a catch-all route (",[407,2261,2262],{},"[...].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.",[1935,2265],{"title":43,"to":44},[400,2267,2269],{"id":2268},"vite-integration","Vite integration",[396,2271,2272],{},"When using Nitro with Vite, the renderer integrates with Vite's build pipeline and dev server.",[617,2274,2276],{"id":2275},"development-mode","Development mode",[396,2278,2279,2280,2282,2283,2286],{},"In development, the renderer template is read from disk on each request, so changes to ",[407,2281,610],{}," are reflected immediately without restarting the server. Vite's ",[407,2284,2285],{},"transformIndexHtml"," hook is applied to inject HMR client scripts and other dev-time transforms.",[617,2288,2290,2291],{"id":2289},"ssr-with-ssr-outlet","SSR with ",[407,2292,2293],{},"\u003C!--ssr-outlet-->",[396,2295,2296,2297,2300,2301,2303,2304,2306],{},"When using Vite environments with an ",[407,2298,2299],{},"ssr"," service, you can add an ",[407,2302,2293],{}," comment to your ",[407,2305,610],{},". Nitro will replace it with the output from your SSR entry during rendering:",[412,2308,2310],{"className":637,"code":2309,"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,2311,2312,2322,2336,2344,2358,2371,2379,2387,2410,2434,2442],{"__ignoreMap":5},[421,2313,2314,2316,2318,2320],{"class":423,"line":424},[421,2315,646],{"class":431},[421,2317,650],{"class":649},[421,2319,653],{"class":461},[421,2321,656],{"class":431},[421,2323,2324,2326,2328,2330,2332,2334],{"class":423,"line":445},[421,2325,661],{"class":431},[421,2327,639],{"class":649},[421,2329,666],{"class":461},[421,2331,669],{"class":431},[421,2333,672],{"class":438},[421,2335,656],{"class":431},[421,2337,2338,2340,2342],{"class":423,"line":452},[421,2339,679],{"class":431},[421,2341,682],{"class":649},[421,2343,656],{"class":431},[421,2345,2346,2348,2350,2352,2354,2356],{"class":423,"line":468},[421,2347,689],{"class":431},[421,2349,692],{"class":649},[421,2351,695],{"class":461},[421,2353,669],{"class":431},[421,2355,700],{"class":438},[421,2357,703],{"class":431},[421,2359,2360,2362,2364,2367,2369],{"class":423,"line":474},[421,2361,689],{"class":431},[421,2363,734],{"class":649},[421,2365,2366],{"class":431},">SSR App\u003C/",[421,2368,734],{"class":649},[421,2370,656],{"class":431},[421,2372,2373,2375,2377],{"class":423,"line":490},[421,2374,746],{"class":431},[421,2376,682],{"class":649},[421,2378,656],{"class":431},[421,2380,2381,2383,2385],{"class":423,"line":504},[421,2382,679],{"class":431},[421,2384,757],{"class":649},[421,2386,656],{"class":431},[421,2388,2389,2391,2393,2395,2397,2399,2402,2404,2406,2408],{"class":423,"line":520},[421,2390,689],{"class":431},[421,2392,766],{"class":649},[421,2394,769],{"class":461},[421,2396,669],{"class":431},[421,2398,774],{"class":438},[421,2400,2401],{"class":431},">",[421,2403,2293],{"class":486},[421,2405,826],{"class":431},[421,2407,766],{"class":649},[421,2409,656],{"class":431},[421,2411,2412,2414,2416,2418,2420,2422,2424,2426,2428,2430,2432],{"class":423,"line":526},[421,2413,689],{"class":431},[421,2415,789],{"class":649},[421,2417,792],{"class":461},[421,2419,669],{"class":431},[421,2421,797],{"class":438},[421,2423,800],{"class":461},[421,2425,669],{"class":431},[421,2427,805],{"class":438},[421,2429,777],{"class":431},[421,2431,789],{"class":649},[421,2433,656],{"class":431},[421,2435,2436,2438,2440],{"class":423,"line":784},[421,2437,746],{"class":431},[421,2439,757],{"class":649},[421,2441,656],{"class":431},[421,2443,2444,2446,2448],{"class":423,"line":814},[421,2445,826],{"class":431},[421,2447,639],{"class":649},[421,2449,656],{"class":431},[617,2451,2453],{"id":2452},"production-build","Production build",[396,2455,2456,2457,2459],{},"During production builds, Vite processes the ",[407,2458,610],{}," through its build pipeline (resolving scripts, CSS, and other assets), then Nitro inlines the transformed HTML into the server bundle.",[400,2461,2463],{"id":2462},"use-cases","Use Cases",[617,2465,2467],{"id":2466},"single-page-application-spa","Single-Page Application (SPA)",[396,2469,2470,2471,2473],{},"Serve your SPA's ",[407,2472,610],{}," for all routes to enable client-side routing:",[899,2475,2476],{},[396,2477,2478],{},"\nThis is the default behavior of Nitro when used with Vite.",[2480,2481,2482],"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":2484},[2485,2486,2493,2494,2495,2501],{"id":402,"depth":445,"text":33},{"id":614,"depth":445,"text":615,"children":2487},[2488,2490,2491,2492],{"id":619,"depth":452,"text":2489},"Auto-detected index.html",{"id":936,"depth":452,"text":937},{"id":1141,"depth":452,"text":1142},{"id":1224,"depth":452,"text":1225},{"id":1940,"depth":445,"text":1941},{"id":2190,"depth":445,"text":2191},{"id":2268,"depth":445,"text":2269,"children":2496},[2497,2498,2500],{"id":2275,"depth":452,"text":2276},{"id":2289,"depth":452,"text":2499},"SSR with \u003C!--ssr-outlet-->",{"id":2452,"depth":452,"text":2453},{"id":2462,"depth":445,"text":2463,"children":2502},[2503],{"id":2466,"depth":452,"text":2467},"Use a renderer to handle all unmatched routes with custom HTML or a templating system.",{"icon":21},{"title":18,"icon":21},{"title":391,"description":2504},"lEhxwCNwYzCgx3lb-gAnoXEITGpEr_CK7lNH1ud0OIk",[2510,2512],{"title":13,"path":14,"stem":15,"description":2511,"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":2513,"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.",1775838238300]