[{"data":1,"prerenderedAt":1365},["ShallowReactive",2],{"navigation":3,"-docs-renderer":228,"-docs-renderer-surround":1360},[4,83,212,218,225],{"title":5,"path":6,"stem":7,"children":8,"icon":82},"","/docs","1.docs/1.index",[9,12,17,22,27,32,37,42,47,52,57,62,67,72,77],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-compass",{"title":13,"path":14,"stem":15,"icon":16},"Quick Start","/docs/quick-start","1.docs/2.quick-start","i-lucide-zap",{"title":18,"path":19,"stem":20,"icon":21},"Renderer","/docs/renderer","1.docs/4.renderer","ri:layout-masonry-line",{"title":23,"path":24,"stem":25,"icon":26},"Routing","/docs/routing","1.docs/5.routing","ri:direction-line",{"title":28,"path":29,"stem":30,"icon":31},"Assets","/docs/assets","1.docs/50.assets","ri:image-2-line",{"title":33,"path":34,"stem":35,"icon":36},"Configuration","/docs/configuration","1.docs/50.configuration","ri:settings-3-line",{"title":38,"path":39,"stem":40,"icon":41},"Database","/docs/database","1.docs/50.database","ri:database-2-line",{"title":43,"path":44,"stem":45,"icon":46},"Lifecycle","/docs/lifecycle","1.docs/50.lifecycle","i-lucide-layers",{"title":48,"path":49,"stem":50,"icon":51},"Plugins","/docs/plugins","1.docs/50.plugins","ri:plug-line",{"title":53,"path":54,"stem":55,"icon":56},"Tasks","/docs/tasks","1.docs/50.tasks","codicon:run-all",{"title":58,"path":59,"stem":60,"icon":61},"Server Entry","/docs/server-entry","1.docs/6.server-entry","ri:server-line",{"title":63,"path":64,"stem":65,"icon":66},"Cache","/docs/cache","1.docs/7.cache","ri:speed-line",{"title":68,"path":69,"stem":70,"icon":71},"KV Storage","/docs/storage","1.docs/8.storage","carbon:datastore",{"title":73,"path":74,"stem":75,"icon":76},"Migration Guide","/docs/migration","1.docs/99.migration","ri:arrow-right-up-line",{"title":78,"path":79,"stem":80,"icon":81},"Nightly Channel","/docs/nightly","1.docs/99.nightly","ri:moon-fill","i-lucide-book-open",{"title":84,"path":85,"stem":86,"children":87,"icon":89},"Deploy","/deploy","2.deploy/0.index",[88,90,111],{"title":84,"path":85,"stem":86,"icon":89},"ri:upload-cloud-2-line",{"title":91,"path":92,"stem":93,"children":94,"page":110},"Runtimes","/deploy/runtimes","2.deploy/10.runtimes",[95,100,105],{"title":96,"path":97,"stem":98,"icon":99},"Node.js","/deploy/runtimes/node","2.deploy/10.runtimes/1.node","akar-icons:node-fill",{"title":101,"path":102,"stem":103,"icon":104},"Bun","/deploy/runtimes/bun","2.deploy/10.runtimes/bun","simple-icons:bun",{"title":106,"path":107,"stem":108,"icon":109},"Deno","/deploy/runtimes/deno","2.deploy/10.runtimes/deno","simple-icons:deno",false,{"title":112,"path":113,"stem":114,"children":115,"page":110},"Providers","/deploy/providers","2.deploy/20.providers",[116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208],{"title":117,"path":118,"stem":119},"Alwaysdata","/deploy/providers/alwaysdata","2.deploy/20.providers/alwaysdata",{"title":121,"path":122,"stem":123},"AWS Lambda","/deploy/providers/aws","2.deploy/20.providers/aws",{"title":125,"path":126,"stem":127},"AWS Amplify","/deploy/providers/aws-amplify","2.deploy/20.providers/aws-amplify",{"title":129,"path":130,"stem":131},"Azure","/deploy/providers/azure","2.deploy/20.providers/azure",{"title":133,"path":134,"stem":135},"Cleavr","/deploy/providers/cleavr","2.deploy/20.providers/cleavr",{"title":137,"path":138,"stem":139},"Cloudflare","/deploy/providers/cloudflare","2.deploy/20.providers/cloudflare",{"title":141,"path":142,"stem":143},"Deno Deploy","/deploy/providers/deno-deploy","2.deploy/20.providers/deno-deploy",{"title":145,"path":146,"stem":147},"DigitalOcean","/deploy/providers/digitalocean","2.deploy/20.providers/digitalocean",{"title":149,"path":150,"stem":151},"Firebase","/deploy/providers/firebase","2.deploy/20.providers/firebase",{"title":153,"path":154,"stem":155},"Flightcontrol","/deploy/providers/flightcontrol","2.deploy/20.providers/flightcontrol",{"title":157,"path":158,"stem":159},"Genezio","/deploy/providers/genezio","2.deploy/20.providers/genezio",{"title":161,"path":162,"stem":163},"GitHub Pages","/deploy/providers/github-pages","2.deploy/20.providers/github-pages",{"title":165,"path":166,"stem":167},"GitLab Pages","/deploy/providers/gitlab-pages","2.deploy/20.providers/gitlab-pages",{"title":169,"path":170,"stem":171},"Heroku","/deploy/providers/heroku","2.deploy/20.providers/heroku",{"title":173,"path":174,"stem":175},"IIS","/deploy/providers/iis","2.deploy/20.providers/iis",{"title":177,"path":178,"stem":179},"Koyeb","/deploy/providers/koyeb","2.deploy/20.providers/koyeb",{"title":181,"path":182,"stem":183},"Netlify","/deploy/providers/netlify","2.deploy/20.providers/netlify",{"title":185,"path":186,"stem":187},"Platform.sh","/deploy/providers/platform-sh","2.deploy/20.providers/platform-sh",{"title":189,"path":190,"stem":191},"Render.com","/deploy/providers/render","2.deploy/20.providers/render",{"title":193,"path":194,"stem":195},"StormKit","/deploy/providers/stormkit","2.deploy/20.providers/stormkit",{"title":197,"path":198,"stem":199},"Vercel","/deploy/providers/vercel","2.deploy/20.providers/vercel",{"title":201,"path":202,"stem":203},"Zeabur","/deploy/providers/zeabur","2.deploy/20.providers/zeabur",{"title":205,"path":206,"stem":207},"Zephyr Cloud","/deploy/providers/zephyr","2.deploy/20.providers/zephyr",{"title":209,"path":210,"stem":211},"Zerops","/deploy/providers/zerops","2.deploy/20.providers/zerops",{"title":213,"path":214,"stem":215,"children":216,"icon":36},"Config","/config","3.config/0.index",[217],{"title":213,"path":214,"stem":215,"icon":36},{"title":219,"path":220,"stem":221,"children":222,"icon":224},"Examples","/examples","4.examples/0.index",[223],{"title":219,"path":220,"stem":221,"icon":224},"i-lucide-folder-code",{"title":5,"path":226,"stem":227},"/","index",{"id":229,"title":230,"body":231,"description":1355,"extension":1280,"meta":1356,"navigation":1357,"path":19,"seo":1358,"stem":20,"__hash__":1359},"content/1.docs/4.renderer.md","Nitro Renderer",{"type":232,"value":233,"toc":1342,"icon":21},"minimark",[234,241,244,249,258,264,267,559,571,574,596,600,607,810,814,825,828,852,855,893,1003,1007,1011,1014,1017,1186,1189,1240,1244,1256,1276,1308,1317,1319,1323,1327,1333,1338],[235,236,237],"warning",{},[238,239,240],"p",{},"Nitro v3 Alpha docs are a work in progress — expect updates, rough edges, and occasional inaccuracies.",[238,242,243],{},"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.",[245,246,248],"h2",{"id":247},"html-template","HTML template",[250,251,253,254],"h3",{"id":252},"auto-detected-indexhtml","Auto-detected ",[255,256,257],"code",{},"index.html",[238,259,260,261,263],{},"By default, Nitro automatically looks for an ",[255,262,257],{}," file in your project src dir.",[238,265,266],{},"If found, Nitro will use it as the renderer template and serve it for all unmatched routes.",[268,269,270,481],"code-group",{},[271,272,276],"pre",{"className":273,"code":274,"filename":257,"language":275,"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",[255,277,278,298,318,329,349,374,389,399,409,432,462,471],{"__ignoreMap":5},[279,280,283,287,291,295],"span",{"class":281,"line":282},"line",1,[279,284,286],{"class":285},"slsVL","\u003C!",[279,288,290],{"class":289},"sByVh","DOCTYPE",[279,292,294],{"class":293},"shcOC"," html",[279,296,297],{"class":285},">\n",[279,299,301,304,306,309,312,316],{"class":281,"line":300},2,[279,302,303],{"class":285},"\u003C",[279,305,275],{"class":289},[279,307,308],{"class":293}," lang",[279,310,311],{"class":285},"=",[279,313,315],{"class":314},"sfrk1","\"en\"",[279,317,297],{"class":285},[279,319,321,324,327],{"class":281,"line":320},3,[279,322,323],{"class":285},"  \u003C",[279,325,326],{"class":289},"head",[279,328,297],{"class":285},[279,330,332,335,338,341,343,346],{"class":281,"line":331},4,[279,333,334],{"class":285},"    \u003C",[279,336,337],{"class":289},"meta",[279,339,340],{"class":293}," charset",[279,342,311],{"class":285},[279,344,345],{"class":314},"\"UTF-8\"",[279,347,348],{"class":285}," />\n",[279,350,352,354,356,359,361,364,367,369,372],{"class":281,"line":351},5,[279,353,334],{"class":285},[279,355,337],{"class":289},[279,357,358],{"class":293}," name",[279,360,311],{"class":285},[279,362,363],{"class":314},"\"viewport\"",[279,365,366],{"class":293}," content",[279,368,311],{"class":285},[279,370,371],{"class":314},"\"width=device-width, initial-scale=1.0\"",[279,373,348],{"class":285},[279,375,377,379,382,385,387],{"class":281,"line":376},6,[279,378,334],{"class":285},[279,380,381],{"class":289},"title",[279,383,384],{"class":285},">My Vite + Nitro App\u003C/",[279,386,381],{"class":289},[279,388,297],{"class":285},[279,390,392,395,397],{"class":281,"line":391},7,[279,393,394],{"class":285},"  \u003C/",[279,396,326],{"class":289},[279,398,297],{"class":285},[279,400,402,404,407],{"class":281,"line":401},8,[279,403,323],{"class":285},[279,405,406],{"class":289},"body",[279,408,297],{"class":285},[279,410,412,414,417,420,422,425,428,430],{"class":281,"line":411},9,[279,413,334],{"class":285},[279,415,416],{"class":289},"div",[279,418,419],{"class":293}," id",[279,421,311],{"class":285},[279,423,424],{"class":314},"\"app\"",[279,426,427],{"class":285},">\u003C/",[279,429,416],{"class":289},[279,431,297],{"class":285},[279,433,435,437,440,443,445,448,451,453,456,458,460],{"class":281,"line":434},10,[279,436,334],{"class":285},[279,438,439],{"class":289},"script",[279,441,442],{"class":293}," type",[279,444,311],{"class":285},[279,446,447],{"class":314},"\"module\"",[279,449,450],{"class":293}," src",[279,452,311],{"class":285},[279,454,455],{"class":314},"\"/src/main.ts\"",[279,457,427],{"class":285},[279,459,439],{"class":289},[279,461,297],{"class":285},[279,463,465,467,469],{"class":281,"line":464},11,[279,466,394],{"class":285},[279,468,406],{"class":289},[279,470,297],{"class":285},[279,472,474,477,479],{"class":281,"line":473},12,[279,475,476],{"class":285},"\u003C/",[279,478,275],{"class":289},[279,480,297],{"class":285},[271,482,487],{"className":483,"code":484,"filename":485,"language":486,"meta":5,"style":5},"language-ts shiki shiki-themes github-light github-dark github-dark","import { defineHandler } from \"nitro/h3\";\n\nexport default defineHandler((event) => {\n  return { hello: \"API\" };\n});\n","routes/api/hello.ts","ts",[255,488,489,507,513,540,554],{"__ignoreMap":5},[279,490,491,495,498,501,504],{"class":281,"line":282},[279,492,494],{"class":493},"so5gQ","import",[279,496,497],{"class":285}," { defineHandler } ",[279,499,500],{"class":493},"from",[279,502,503],{"class":314}," \"nitro/h3\"",[279,505,506],{"class":285},";\n",[279,508,509],{"class":281,"line":300},[279,510,512],{"emptyLinePlaceholder":511},true,"\n",[279,514,515,518,521,524,527,531,534,537],{"class":281,"line":320},[279,516,517],{"class":493},"export",[279,519,520],{"class":493}," default",[279,522,523],{"class":293}," defineHandler",[279,525,526],{"class":285},"((",[279,528,530],{"class":529},"sQHwn","event",[279,532,533],{"class":285},") ",[279,535,536],{"class":493},"=>",[279,538,539],{"class":285}," {\n",[279,541,542,545,548,551],{"class":281,"line":331},[279,543,544],{"class":493},"  return",[279,546,547],{"class":285}," { hello: ",[279,549,550],{"class":314},"\"API\"",[279,552,553],{"class":285}," };\n",[279,555,556],{"class":281,"line":351},[279,557,558],{"class":285},"});\n",[560,561,562],"tip",{},[238,563,564,565,567,568],{},"When ",[255,566,257],{}," is detected, Nitro will automatically log in the terminal: ",[255,569,570],{},"Using index.html as renderer template.",[238,572,573],{},"With this setup:",[575,576,577,584],"ul",{},[578,579,580,583],"li",{},[255,581,582],{},"/api/hello"," → Handled by your API routes",[578,585,586,589,590,593,594],{},[255,587,588],{},"/about",", ",[255,591,592],{},"/contact",", etc. → Served with ",[255,595,257],{},[250,597,599],{"id":598},"custom-html-file","Custom HTML file",[238,601,602,603,606],{},"You can specify a custom HTML template file using the ",[255,604,605],{},"renderer.template"," option in your Nitro configuration.",[268,608,609,668],{},[271,610,613],{"className":483,"code":611,"filename":612,"language":486,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  renderer: {\n    template: './app.html'\n  }\n})\n","nitro.config.ts",[255,614,615,629,633,645,650,658,663],{"__ignoreMap":5},[279,616,617,619,622,624,627],{"class":281,"line":282},[279,618,494],{"class":493},[279,620,621],{"class":285}," { defineNitroConfig } ",[279,623,500],{"class":493},[279,625,626],{"class":314}," \"nitro/config\"",[279,628,506],{"class":285},[279,630,631],{"class":281,"line":300},[279,632,512],{"emptyLinePlaceholder":511},[279,634,635,637,639,642],{"class":281,"line":320},[279,636,517],{"class":493},[279,638,520],{"class":493},[279,640,641],{"class":293}," defineNitroConfig",[279,643,644],{"class":285},"({\n",[279,646,647],{"class":281,"line":331},[279,648,649],{"class":285},"  renderer: {\n",[279,651,652,655],{"class":281,"line":351},[279,653,654],{"class":285},"    template: ",[279,656,657],{"class":314},"'./app.html'\n",[279,659,660],{"class":281,"line":376},[279,661,662],{"class":285},"  }\n",[279,664,665],{"class":281,"line":391},[279,666,667],{"class":285},"})\n",[271,669,672],{"className":273,"code":670,"filename":671,"language":275,"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",[255,673,674,684,698,706,720,733,741,749,769,794,802],{"__ignoreMap":5},[279,675,676,678,680,682],{"class":281,"line":282},[279,677,286],{"class":285},[279,679,290],{"class":289},[279,681,294],{"class":293},[279,683,297],{"class":285},[279,685,686,688,690,692,694,696],{"class":281,"line":300},[279,687,303],{"class":285},[279,689,275],{"class":289},[279,691,308],{"class":293},[279,693,311],{"class":285},[279,695,315],{"class":314},[279,697,297],{"class":285},[279,699,700,702,704],{"class":281,"line":320},[279,701,323],{"class":285},[279,703,326],{"class":289},[279,705,297],{"class":285},[279,707,708,710,712,714,716,718],{"class":281,"line":331},[279,709,334],{"class":285},[279,711,337],{"class":289},[279,713,340],{"class":293},[279,715,311],{"class":285},[279,717,345],{"class":314},[279,719,348],{"class":285},[279,721,722,724,726,729,731],{"class":281,"line":351},[279,723,334],{"class":285},[279,725,381],{"class":289},[279,727,728],{"class":285},">Custom Template\u003C/",[279,730,381],{"class":289},[279,732,297],{"class":285},[279,734,735,737,739],{"class":281,"line":376},[279,736,394],{"class":285},[279,738,326],{"class":289},[279,740,297],{"class":285},[279,742,743,745,747],{"class":281,"line":391},[279,744,323],{"class":285},[279,746,406],{"class":289},[279,748,297],{"class":285},[279,750,751,753,755,757,759,762,765,767],{"class":281,"line":401},[279,752,334],{"class":285},[279,754,416],{"class":289},[279,756,419],{"class":293},[279,758,311],{"class":285},[279,760,761],{"class":314},"\"root\"",[279,763,764],{"class":285},">Loading...\u003C/",[279,766,416],{"class":289},[279,768,297],{"class":285},[279,770,771,773,775,777,779,781,783,785,788,790,792],{"class":281,"line":411},[279,772,334],{"class":285},[279,774,439],{"class":289},[279,776,442],{"class":293},[279,778,311],{"class":285},[279,780,447],{"class":314},[279,782,450],{"class":293},[279,784,311],{"class":285},[279,786,787],{"class":314},"\"/src/main.js\"",[279,789,427],{"class":285},[279,791,439],{"class":289},[279,793,297],{"class":285},[279,795,796,798,800],{"class":281,"line":434},[279,797,394],{"class":285},[279,799,406],{"class":289},[279,801,297],{"class":285},[279,803,804,806,808],{"class":281,"line":464},[279,805,476],{"class":285},[279,807,275],{"class":289},[279,809,297],{"class":285},[250,811,813],{"id":812},"hypertext-preprocessor-experimental","Hypertext Preprocessor (experimental)",[238,815,816,817,824],{},"Nitro uses ",[818,819,823],"a",{"href":820,"rel":821},"https://github.com/h3js/rendu",[822],"nofollow","rendu"," Hypertext Preprocessor, which provides a simple and powerful way to create dynamic HTML templates with JavaScript expressions.",[238,826,827],{},"You can use special delimiters to inject dynamic content:",[575,829,830,836,846],{},[578,831,832,835],{},[255,833,834],{},"{{ content }}"," to output HTML-escaped content",[578,837,838,841,842,845],{},[255,839,840],{},"{{{ content }}}"," or ",[255,843,844],{},"\u003C?= expression ?>"," to output raw (unescaped) content",[578,847,848,851],{},[255,849,850],{},"\u003C? ... ?>"," for JavaScript control flow",[238,853,854],{},"It also exposes global variables:",[575,856,857,863,869,875,881,887],{},[578,858,859,862],{},[255,860,861],{},"$REQUEST",": The incoming Request object",[578,864,865,868],{},[255,866,867],{},"$METHOD",": HTTP method (GET, POST, etc.)",[578,870,871,874],{},[255,872,873],{},"$URL",": Request URL object",[578,876,877,880],{},[255,878,879],{},"$HEADERS",": Request headers",[578,882,883,886],{},[255,884,885],{},"$RESPONSE",": Response configuration object",[578,888,889,892],{},[255,890,891],{},"$COOKIES",": Read-only object containing request cookies",[271,894,896],{"className":273,"code":895,"filename":257,"language":275,"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  \u003C/body>\n\u003C/html>\n",[255,897,898,908,922,930,944,957,965,973,987,995],{"__ignoreMap":5},[279,899,900,902,904,906],{"class":281,"line":282},[279,901,286],{"class":285},[279,903,290],{"class":289},[279,905,294],{"class":293},[279,907,297],{"class":285},[279,909,910,912,914,916,918,920],{"class":281,"line":300},[279,911,303],{"class":285},[279,913,275],{"class":289},[279,915,308],{"class":293},[279,917,311],{"class":285},[279,919,315],{"class":314},[279,921,297],{"class":285},[279,923,924,926,928],{"class":281,"line":320},[279,925,323],{"class":285},[279,927,326],{"class":289},[279,929,297],{"class":285},[279,931,932,934,936,938,940,942],{"class":281,"line":331},[279,933,334],{"class":285},[279,935,337],{"class":289},[279,937,340],{"class":293},[279,939,311],{"class":285},[279,941,345],{"class":314},[279,943,348],{"class":285},[279,945,946,948,950,953,955],{"class":281,"line":351},[279,947,334],{"class":285},[279,949,381],{"class":289},[279,951,952],{"class":285},">Dynamic template\u003C/",[279,954,381],{"class":289},[279,956,297],{"class":285},[279,958,959,961,963],{"class":281,"line":376},[279,960,394],{"class":285},[279,962,326],{"class":289},[279,964,297],{"class":285},[279,966,967,969,971],{"class":281,"line":391},[279,968,323],{"class":285},[279,970,406],{"class":289},[279,972,297],{"class":285},[279,974,975,977,980,983,985],{"class":281,"line":401},[279,976,334],{"class":285},[279,978,979],{"class":289},"h1",[279,981,982],{"class":285},">Hello {{ $REQUEST.url }}\u003C/",[279,984,979],{"class":289},[279,986,297],{"class":285},[279,988,989,991,993],{"class":281,"line":411},[279,990,394],{"class":285},[279,992,406],{"class":289},[279,994,297],{"class":285},[279,996,997,999,1001],{"class":281,"line":434},[279,998,476],{"class":285},[279,1000,275],{"class":289},[279,1002,297],{"class":285},[1004,1005],"read-more",{"title":1006,"to":820},"Rendu Documentation",[245,1008,1010],{"id":1009},"custom-renderer-handler","Custom renderer handler",[238,1012,1013],{},"For more complex scenarios, you can create a custom renderer handler that programmatically generates responses.",[238,1015,1016],{},"Create a renderer file to define your custom rendering logic:",[271,1018,1021],{"className":483,"code":1019,"filename":1020,"language":486,"meta":5,"style":5},"export default function renderer({ req, url }: { req: Request; url: 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",[255,1022,1023,1075,1088,1097,1102,1107,1112,1117,1122,1127,1143,1148,1156,1174,1180],{"__ignoreMap":5},[279,1024,1025,1027,1029,1032,1035,1038,1041,1043,1046,1049,1052,1055,1057,1059,1062,1065,1067,1069,1072],{"class":281,"line":282},[279,1026,517],{"class":493},[279,1028,520],{"class":493},[279,1030,1031],{"class":493}," function",[279,1033,1034],{"class":293}," renderer",[279,1036,1037],{"class":285},"({ ",[279,1039,1040],{"class":529},"req",[279,1042,589],{"class":285},[279,1044,1045],{"class":529},"url",[279,1047,1048],{"class":285}," }",[279,1050,1051],{"class":493},":",[279,1053,1054],{"class":285}," { ",[279,1056,1040],{"class":529},[279,1058,1051],{"class":493},[279,1060,1061],{"class":293}," Request",[279,1063,1064],{"class":285},"; ",[279,1066,1045],{"class":529},[279,1068,1051],{"class":493},[279,1070,1071],{"class":293}," URL",[279,1073,1074],{"class":285}," }) {\n",[279,1076,1077,1079,1082,1085],{"class":281,"line":300},[279,1078,544],{"class":493},[279,1080,1081],{"class":493}," new",[279,1083,1084],{"class":293}," Response",[279,1086,1087],{"class":285},"(\n",[279,1089,1090,1094],{"class":281,"line":320},[279,1091,1093],{"class":1092},"sCsY4","    /* html */",[279,1095,1096],{"class":314}," `\u003C!DOCTYPE html>\n",[279,1098,1099],{"class":281,"line":331},[279,1100,1101],{"class":314},"    \u003Chtml>\n",[279,1103,1104],{"class":281,"line":351},[279,1105,1106],{"class":314},"    \u003Chead>\n",[279,1108,1109],{"class":281,"line":376},[279,1110,1111],{"class":314},"      \u003Ctitle>Custom Renderer\u003C/title>\n",[279,1113,1114],{"class":281,"line":391},[279,1115,1116],{"class":314},"    \u003C/head>\n",[279,1118,1119],{"class":281,"line":401},[279,1120,1121],{"class":314},"    \u003Cbody>\n",[279,1123,1124],{"class":281,"line":411},[279,1125,1126],{"class":314},"      \u003Ch1>Hello from custom renderer!\u003C/h1>\n",[279,1128,1129,1132,1134,1137,1140],{"class":281,"line":434},[279,1130,1131],{"class":314},"      \u003Cp>Current path: ${",[279,1133,1045],{"class":285},[279,1135,1136],{"class":314},".",[279,1138,1139],{"class":285},"pathname",[279,1141,1142],{"class":314},"}\u003C/p>\n",[279,1144,1145],{"class":281,"line":464},[279,1146,1147],{"class":314},"    \u003C/body>\n",[279,1149,1150,1153],{"class":281,"line":473},[279,1151,1152],{"class":314},"    \u003C/html>`",[279,1154,1155],{"class":285},",\n",[279,1157,1159,1162,1165,1168,1171],{"class":281,"line":1158},13,[279,1160,1161],{"class":285},"    { headers: { ",[279,1163,1164],{"class":314},"\"content-type\"",[279,1166,1167],{"class":285},": ",[279,1169,1170],{"class":314},"\"text/html; charset=utf-8\"",[279,1172,1173],{"class":285}," } }\n",[279,1175,1177],{"class":281,"line":1176},14,[279,1178,1179],{"class":285},"  );\n",[279,1181,1183],{"class":281,"line":1182},15,[279,1184,1185],{"class":285},"}\n",[238,1187,1188],{},"Then, specify the renderer entry in the Nitro config:",[271,1190,1192],{"className":483,"code":1191,"filename":612,"language":486,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  renderer: {\n    handler: './renderer.ts'\n  }\n})\n",[255,1193,1194,1206,1210,1220,1224,1232,1236],{"__ignoreMap":5},[279,1195,1196,1198,1200,1202,1204],{"class":281,"line":282},[279,1197,494],{"class":493},[279,1199,621],{"class":285},[279,1201,500],{"class":493},[279,1203,626],{"class":314},[279,1205,506],{"class":285},[279,1207,1208],{"class":281,"line":300},[279,1209,512],{"emptyLinePlaceholder":511},[279,1211,1212,1214,1216,1218],{"class":281,"line":320},[279,1213,517],{"class":493},[279,1215,520],{"class":493},[279,1217,641],{"class":293},[279,1219,644],{"class":285},[279,1221,1222],{"class":281,"line":331},[279,1223,649],{"class":285},[279,1225,1226,1229],{"class":281,"line":351},[279,1227,1228],{"class":285},"    handler: ",[279,1230,1231],{"class":314},"'./renderer.ts'\n",[279,1233,1234],{"class":281,"line":376},[279,1235,662],{"class":285},[279,1237,1238],{"class":281,"line":391},[279,1239,667],{"class":285},[245,1241,1243],{"id":1242},"renderer-priority","Renderer priority",[238,1245,1246,1247,1250,1251,1255],{},"The renderer always acts as a catch-all route (",[255,1248,1249],{},"/**",") and has the ",[1252,1253,1254],"strong",{},"lowest priority",". This means:",[1257,1258,1260,1268,1273],"steps",{"level":1259},"4",[1261,1262,1263,1264,1267],"h4",{},"Specific API routes are matched first (e.g., ",[255,1265,1266],{},"/api/users",")",[1261,1269,1270,1271,1267],{},"Specific server routes are matched next (e.g., ",[255,1272,588],{},[1261,1274,1275],{},"The renderer catches everything else",[271,1277,1281],{"className":1278,"code":1279,"language":1280,"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",[255,1282,1283,1288,1293,1298,1303],{"__ignoreMap":5},[279,1284,1285],{"class":281,"line":282},[279,1286,1287],{"class":285},"api/\n",[279,1289,1290],{"class":281,"line":300},[279,1291,1292],{"class":285},"  users.ts        → /api/users (matched first)\n",[279,1294,1295],{"class":281,"line":320},[279,1296,1297],{"class":285},"routes/\n",[279,1299,1300],{"class":281,"line":331},[279,1301,1302],{"class":285},"  about.ts        → /about (matched second)\n",[279,1304,1305],{"class":281,"line":351},[279,1306,1307],{"class":285},"renderer.ts         → /** (catches all other routes)\n",[235,1309,1310],{},[238,1311,1312,1313,1316],{},"If you define a catch-all route (",[255,1314,1315],{},"[...].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.",[1004,1318],{"title":43,"to":44},[245,1320,1322],{"id":1321},"use-cases","Use Cases",[250,1324,1326],{"id":1325},"single-page-application-spa","Single-Page Application (SPA)",[238,1328,1329,1330,1332],{},"Serve your SPA's ",[255,1331,257],{}," for all routes to enable client-side routing:",[560,1334,1335],{},[238,1336,1337],{},"\nThis is the default behavior of Nitro when used with Vite.",[1339,1340,1341],"style",{},"html pre.shiki code .slsVL, html code.shiki .slsVL{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .sByVh, html code.shiki .sByVh{--shiki-light:#22863A;--shiki-default:#85E89D;--shiki-dark:#85E89D}html pre.shiki code .shcOC, html code.shiki .shcOC{--shiki-light:#6F42C1;--shiki-default:#B392F0;--shiki-dark:#B392F0}html pre.shiki code .sfrk1, html code.shiki .sfrk1{--shiki-light:#032F62;--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF}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 .so5gQ, html code.shiki .so5gQ{--shiki-light:#D73A49;--shiki-default:#F97583;--shiki-dark:#F97583}html pre.shiki code .sQHwn, html code.shiki .sQHwn{--shiki-light:#E36209;--shiki-default:#FFAB70;--shiki-dark:#FFAB70}html pre.shiki code .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":5,"searchDepth":300,"depth":300,"links":1343},[1344,1350,1351,1352],{"id":247,"depth":300,"text":248,"children":1345},[1346,1348,1349],{"id":252,"depth":320,"text":1347},"Auto-detected index.html",{"id":598,"depth":320,"text":599},{"id":812,"depth":320,"text":813},{"id":1009,"depth":300,"text":1010},{"id":1242,"depth":300,"text":1243},{"id":1321,"depth":300,"text":1322,"children":1353},[1354],{"id":1325,"depth":320,"text":1326},"Use a renderer to handle all unmatched routes with custom HTML or a templating system.",{"icon":21},{"title":18,"icon":21},{"title":230,"description":1355},"NXs1hrGFDb7ahF3-5-ilo50iyL6Hx-k4CFEvltZOJik",[1361,1363],{"title":13,"path":14,"stem":15,"description":1362,"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":1364,"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.",1773176969984]