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