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