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