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