[{"data":1,"prerenderedAt":1499},["ShallowReactive",2],{"navigation":3,"-docs-assets":402,"-docs-assets-surround":1494},[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":28,"body":404,"description":5,"extension":444,"meta":1490,"navigation":1491,"path":29,"seo":1492,"stem":30,"__hash__":1493},"content/1.docs/50.assets.md",{"type":405,"value":406,"toc":1479,"icon":31},"minimark",[407,420,425,433,439,474,479,502,517,521,531,759,762,766,773,839,941,951,955,973,980,1024,1027,1098,1108,1112,1122,1132,1143,1150,1247,1251,1256,1263,1294,1365,1372,1466,1475],[408,409,410,411,415,416,419],"p",{},"Nitro supports two types of assets: ",[412,413,414],"strong",{},"public assets"," served directly to clients and ",[412,417,418],{},"server assets"," bundled into the server for programmatic access.",[421,422,424],"h2",{"id":423},"public-assets","Public Assets",[408,426,427,428,432],{},"Nitro handles assets via the ",[429,430,431],"code",{},"public/"," directory.",[408,434,435,436,438],{},"All assets in ",[429,437,431],{}," directory will be automatically served. This means that you can access them directly from the browser without any special configuration.",[440,441,445],"pre",{"className":442,"code":443,"language":444,"meta":5,"style":5},"language-md shiki shiki-themes github-light github-dark github-dark","public/\n  image.png     \u003C-- /image.png\n  video.mp4     \u003C-- /video.mp4\n  robots.txt    \u003C-- /robots.txt\n","md",[429,446,447,456,462,468],{"__ignoreMap":5},[448,449,452],"span",{"class":450,"line":451},"line",1,[448,453,455],{"class":454},"slsVL","public/\n",[448,457,459],{"class":450,"line":458},2,[448,460,461],{"class":454},"  image.png     \u003C-- /image.png\n",[448,463,465],{"class":450,"line":464},3,[448,466,467],{"class":454},"  video.mp4     \u003C-- /video.mp4\n",[448,469,471],{"class":450,"line":470},4,[448,472,473],{"class":454},"  robots.txt    \u003C-- /robots.txt\n",[475,476,478],"h3",{"id":477},"caching-and-headers","Caching and Headers",[408,480,481,482,485,486,489,490,493,494,497,498,501],{},"Public assets are served with automatic ",[429,483,484],{},"ETag"," and ",[429,487,488],{},"Last-Modified"," headers for conditional requests. When the client sends ",[429,491,492],{},"If-None-Match"," or ",[429,495,496],{},"If-Modified-Since"," headers, Nitro returns a ",[429,499,500],{},"304 Not Modified"," response.",[408,503,504,505,508,509,512,513,516],{},"For assets served from a non-root ",[429,506,507],{},"baseURL"," (such as ",[429,510,511],{},"/build/","), Nitro prevents fallthrough to application handlers. If a request matches a public asset base but the file is not found, a ",[429,514,515],{},"404"," is returned immediately.",[475,518,520],{"id":519},"production-public-assets","Production Public Assets",[408,522,523,524,526,527,530],{},"When building your Nitro app, the ",[429,525,431],{}," directory will be copied to ",[429,528,529],{},".output/public/"," and a manifest with metadata will be created and embedded in the server bundle.",[440,532,536],{"className":533,"code":534,"language":535,"meta":5,"style":5},"language-json shiki shiki-themes github-light github-dark github-dark","{\n  \"/image.png\": {\n    \"type\": \"image/png\",\n    \"etag\": \"\\\"4a0c-6utWq0Kbk5OqDmksYCa9XV8irnM\\\"\",\n    \"mtime\": \"2023-03-04T21:39:45.086Z\",\n    \"size\": 18956\n  },\n  \"/robots.txt\": {\n    \"type\": \"text/plain; charset=utf-8\",\n    \"etag\": \"\\\"8-hMqyDrA8fJ0R904zgEPs3L55Jls\\\"\",\n    \"mtime\": \"2023-03-04T21:39:45.086Z\",\n    \"size\": 8\n  },\n  \"/video.mp4\": {\n    \"type\": \"video/mp4\",\n    \"etag\": \"\\\"9b943-4UwfQXKUjPCesGPr6J5j7GzNYGU\\\"\",\n    \"mtime\": \"2023-03-04T21:39:45.085Z\",\n    \"size\": 637251\n  }\n}\n","json",[429,537,538,543,552,567,589,602,613,619,627,639,659,670,680,685,693,705,725,737,747,753],{"__ignoreMap":5},[448,539,540],{"class":450,"line":451},[448,541,542],{"class":454},"{\n",[448,544,545,549],{"class":450,"line":458},[448,546,548],{"class":547},"suiK_","  \"/image.png\"",[448,550,551],{"class":454},": {\n",[448,553,554,557,560,564],{"class":450,"line":464},[448,555,556],{"class":547},"    \"type\"",[448,558,559],{"class":454},": ",[448,561,563],{"class":562},"sfrk1","\"image/png\"",[448,565,566],{"class":454},",\n",[448,568,569,572,574,577,580,583,585,587],{"class":450,"line":470},[448,570,571],{"class":547},"    \"etag\"",[448,573,559],{"class":454},[448,575,576],{"class":562},"\"",[448,578,579],{"class":547},"\\\"",[448,581,582],{"class":562},"4a0c-6utWq0Kbk5OqDmksYCa9XV8irnM",[448,584,579],{"class":547},[448,586,576],{"class":562},[448,588,566],{"class":454},[448,590,592,595,597,600],{"class":450,"line":591},5,[448,593,594],{"class":547},"    \"mtime\"",[448,596,559],{"class":454},[448,598,599],{"class":562},"\"2023-03-04T21:39:45.086Z\"",[448,601,566],{"class":454},[448,603,605,608,610],{"class":450,"line":604},6,[448,606,607],{"class":547},"    \"size\"",[448,609,559],{"class":454},[448,611,612],{"class":547},"18956\n",[448,614,616],{"class":450,"line":615},7,[448,617,618],{"class":454},"  },\n",[448,620,622,625],{"class":450,"line":621},8,[448,623,624],{"class":547},"  \"/robots.txt\"",[448,626,551],{"class":454},[448,628,630,632,634,637],{"class":450,"line":629},9,[448,631,556],{"class":547},[448,633,559],{"class":454},[448,635,636],{"class":562},"\"text/plain; charset=utf-8\"",[448,638,566],{"class":454},[448,640,642,644,646,648,650,653,655,657],{"class":450,"line":641},10,[448,643,571],{"class":547},[448,645,559],{"class":454},[448,647,576],{"class":562},[448,649,579],{"class":547},[448,651,652],{"class":562},"8-hMqyDrA8fJ0R904zgEPs3L55Jls",[448,654,579],{"class":547},[448,656,576],{"class":562},[448,658,566],{"class":454},[448,660,662,664,666,668],{"class":450,"line":661},11,[448,663,594],{"class":547},[448,665,559],{"class":454},[448,667,599],{"class":562},[448,669,566],{"class":454},[448,671,673,675,677],{"class":450,"line":672},12,[448,674,607],{"class":547},[448,676,559],{"class":454},[448,678,679],{"class":547},"8\n",[448,681,683],{"class":450,"line":682},13,[448,684,618],{"class":454},[448,686,688,691],{"class":450,"line":687},14,[448,689,690],{"class":547},"  \"/video.mp4\"",[448,692,551],{"class":454},[448,694,696,698,700,703],{"class":450,"line":695},15,[448,697,556],{"class":547},[448,699,559],{"class":454},[448,701,702],{"class":562},"\"video/mp4\"",[448,704,566],{"class":454},[448,706,708,710,712,714,716,719,721,723],{"class":450,"line":707},16,[448,709,571],{"class":547},[448,711,559],{"class":454},[448,713,576],{"class":562},[448,715,579],{"class":547},[448,717,718],{"class":562},"9b943-4UwfQXKUjPCesGPr6J5j7GzNYGU",[448,720,579],{"class":547},[448,722,576],{"class":562},[448,724,566],{"class":454},[448,726,728,730,732,735],{"class":450,"line":727},17,[448,729,594],{"class":547},[448,731,559],{"class":454},[448,733,734],{"class":562},"\"2023-03-04T21:39:45.085Z\"",[448,736,566],{"class":454},[448,738,740,742,744],{"class":450,"line":739},18,[448,741,607],{"class":547},[448,743,559],{"class":454},[448,745,746],{"class":547},"637251\n",[448,748,750],{"class":450,"line":749},19,[448,751,752],{"class":454},"  }\n",[448,754,756],{"class":450,"line":755},20,[448,757,758],{"class":454},"}\n",[408,760,761],{},"This allows Nitro to know the public assets without scanning the directory, giving high performance with caching headers.",[475,763,765],{"id":764},"custom-public-asset-directories","Custom Public Asset Directories",[408,767,768,769,772],{},"You can configure additional public asset directories using the ",[429,770,771],{},"publicAssets"," config option. Each entry supports the following properties:",[774,775,776,787,795,809,827],"ul",{},[777,778,779,782,783,786],"li",{},[429,780,781],{},"dir"," -- Path to the directory (resolved relative to ",[429,784,785],{},"rootDir",").",[777,788,789,791,792,786],{},[429,790,507],{}," -- URL prefix for serving assets (default: ",[429,793,794],{},"\"/\"",[777,796,797,800,801,804,805,808],{},[429,798,799],{},"maxAge"," -- Cache ",[429,802,803],{},"max-age"," in seconds. When set, a ",[429,806,807],{},"Cache-Control: public, max-age=\u003Cvalue>, immutable"," header is applied via route rules.",[777,810,811,814,815,818,819,822,823,826],{},[429,812,813],{},"fallthrough"," -- Whether requests should fall through to application handlers when the asset is not found. Top-level (",[429,816,817],{},"baseURL: \"/\"",") directories default to ",[429,820,821],{},"true","; non-root directories default to ",[429,824,825],{},"false",".",[777,828,829,832,833,835,836,838],{},[429,830,831],{},"ignore"," -- Pass ",[429,834,825],{}," to disable ignore patterns, or an array of glob patterns to override the global ",[429,837,831],{}," option.",[440,840,845],{"className":841,"code":842,"filename":843,"language":844,"meta":5,"style":5},"language-js shiki shiki-themes github-light github-dark github-dark","import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  publicAssets: [\n    {\n      baseURL: \"build\",\n      dir: \"public/build\",\n      maxAge: 3600,\n    },\n  ],\n});\n","nitro.config.ts","js",[429,846,847,865,871,886,891,896,906,916,926,931,936],{"__ignoreMap":5},[448,848,849,853,856,859,862],{"class":450,"line":451},[448,850,852],{"class":851},"so5gQ","import",[448,854,855],{"class":454}," { defineConfig } ",[448,857,858],{"class":851},"from",[448,860,861],{"class":562}," \"nitro\"",[448,863,864],{"class":454},";\n",[448,866,867],{"class":450,"line":458},[448,868,870],{"emptyLinePlaceholder":869},true,"\n",[448,872,873,876,879,883],{"class":450,"line":464},[448,874,875],{"class":851},"export",[448,877,878],{"class":851}," default",[448,880,882],{"class":881},"shcOC"," defineConfig",[448,884,885],{"class":454},"({\n",[448,887,888],{"class":450,"line":470},[448,889,890],{"class":454},"  publicAssets: [\n",[448,892,893],{"class":450,"line":591},[448,894,895],{"class":454},"    {\n",[448,897,898,901,904],{"class":450,"line":604},[448,899,900],{"class":454},"      baseURL: ",[448,902,903],{"class":562},"\"build\"",[448,905,566],{"class":454},[448,907,908,911,914],{"class":450,"line":615},[448,909,910],{"class":454},"      dir: ",[448,912,913],{"class":562},"\"public/build\"",[448,915,566],{"class":454},[448,917,918,921,924],{"class":450,"line":621},[448,919,920],{"class":454},"      maxAge: ",[448,922,923],{"class":547},"3600",[448,925,566],{"class":454},[448,927,928],{"class":450,"line":629},[448,929,930],{"class":454},"    },\n",[448,932,933],{"class":450,"line":641},[448,934,935],{"class":454},"  ],\n",[448,937,938],{"class":450,"line":661},[448,939,940],{"class":454},"});\n",[408,942,943,944,947,948,950],{},"In this example, files in ",[429,945,946],{},"public/build/"," are served under ",[429,949,511],{}," with a one-hour cache and no fallthrough to application handlers.",[475,952,954],{"id":953},"compressed-public-assets","Compressed Public Assets",[408,956,957,958,961,962,965,966,969,970,786],{},"Nitro can generate pre-compressed versions of your public assets during the build. When a client sends an ",[429,959,960],{},"Accept-Encoding"," header, the server will serve the compressed version if available. Supported encodings are gzip (",[429,963,964],{},".gz","), brotli (",[429,967,968],{},".br","), and zstd (",[429,971,972],{},".zst",[408,974,975,976,979],{},"Set ",[429,977,978],{},"compressPublicAssets: true"," to enable all encodings:",[440,981,983],{"className":841,"code":982,"filename":843,"language":844,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  compressPublicAssets: true,\n});\n",[429,984,985,997,1001,1011,1020],{"__ignoreMap":5},[448,986,987,989,991,993,995],{"class":450,"line":451},[448,988,852],{"class":851},[448,990,855],{"class":454},[448,992,858],{"class":851},[448,994,861],{"class":562},[448,996,864],{"class":454},[448,998,999],{"class":450,"line":458},[448,1000,870],{"emptyLinePlaceholder":869},[448,1002,1003,1005,1007,1009],{"class":450,"line":464},[448,1004,875],{"class":851},[448,1006,878],{"class":851},[448,1008,882],{"class":881},[448,1010,885],{"class":454},[448,1012,1013,1016,1018],{"class":450,"line":470},[448,1014,1015],{"class":454},"  compressPublicAssets: ",[448,1017,821],{"class":547},[448,1019,566],{"class":454},[448,1021,1022],{"class":450,"line":591},[448,1023,940],{"class":454},[408,1025,1026],{},"Or pick specific encodings:",[440,1028,1030],{"className":841,"code":1029,"filename":843,"language":844,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  compressPublicAssets: {\n    gzip: true,\n    brotli: true,\n    zstd: false,\n  },\n});\n",[429,1031,1032,1044,1048,1058,1063,1072,1081,1090,1094],{"__ignoreMap":5},[448,1033,1034,1036,1038,1040,1042],{"class":450,"line":451},[448,1035,852],{"class":851},[448,1037,855],{"class":454},[448,1039,858],{"class":851},[448,1041,861],{"class":562},[448,1043,864],{"class":454},[448,1045,1046],{"class":450,"line":458},[448,1047,870],{"emptyLinePlaceholder":869},[448,1049,1050,1052,1054,1056],{"class":450,"line":464},[448,1051,875],{"class":851},[448,1053,878],{"class":851},[448,1055,882],{"class":881},[448,1057,885],{"class":454},[448,1059,1060],{"class":450,"line":470},[448,1061,1062],{"class":454},"  compressPublicAssets: {\n",[448,1064,1065,1068,1070],{"class":450,"line":591},[448,1066,1067],{"class":454},"    gzip: ",[448,1069,821],{"class":547},[448,1071,566],{"class":454},[448,1073,1074,1077,1079],{"class":450,"line":604},[448,1075,1076],{"class":454},"    brotli: ",[448,1078,821],{"class":547},[448,1080,566],{"class":454},[448,1082,1083,1086,1088],{"class":450,"line":615},[448,1084,1085],{"class":454},"    zstd: ",[448,1087,825],{"class":547},[448,1089,566],{"class":454},[448,1091,1092],{"class":450,"line":621},[448,1093,618],{"class":454},[448,1095,1096],{"class":450,"line":629},[448,1097,940],{"class":454},[1099,1100,1101],"note",{},[408,1102,1103,1104,1107],{},"\nOnly compressible MIME types (text, JavaScript, JSON, XML, WASM, fonts, SVG, etc.) with a file size of at least 1 KB are compressed. Source map files (",[429,1105,1106],{},".map",") are excluded.",[421,1109,1111],{"id":1110},"server-assets","Server Assets",[408,1113,435,1114,1117,1118,1121],{},[429,1115,1116],{},"assets/"," directory will be added to the server bundle. After building your application, you can find them in the ",[429,1119,1120],{},".output/server/chunks/raw/"," directory. Be careful with the size of your assets, as they will be bundled with the server bundle.",[1123,1124,1125],"tip",{},[408,1126,1127,1128,1131],{},"\nUnless using ",[429,1129,1130],{},"useStorage()",", assets won't be included in the server bundle.",[408,1133,1134,1135,1138,1139,826],{},"They can be addressed by the ",[429,1136,1137],{},"assets:server"," mount point using the ",[1140,1141,1142],"a",{"href":79},"storage layer",[408,1144,1145,1146,1149],{},"For example, you could store a json file in ",[429,1147,1148],{},"assets/data.json"," and retrieve it in your handler:",[440,1151,1153],{"className":841,"code":1152,"language":844,"meta":5,"style":5},"import { defineHandler } from \"nitro\";\n\nexport default defineHandler(async () => {\n  const data = await useStorage(\"assets:server\").get(\"data.json\");\n\n  return data;\n});\n",[429,1154,1155,1168,1172,1196,1231,1235,1243],{"__ignoreMap":5},[448,1156,1157,1159,1162,1164,1166],{"class":450,"line":451},[448,1158,852],{"class":851},[448,1160,1161],{"class":454}," { defineHandler } ",[448,1163,858],{"class":851},[448,1165,861],{"class":562},[448,1167,864],{"class":454},[448,1169,1170],{"class":450,"line":458},[448,1171,870],{"emptyLinePlaceholder":869},[448,1173,1174,1176,1178,1181,1184,1187,1190,1193],{"class":450,"line":464},[448,1175,875],{"class":851},[448,1177,878],{"class":851},[448,1179,1180],{"class":881}," defineHandler",[448,1182,1183],{"class":454},"(",[448,1185,1186],{"class":851},"async",[448,1188,1189],{"class":454}," () ",[448,1191,1192],{"class":851},"=>",[448,1194,1195],{"class":454}," {\n",[448,1197,1198,1201,1204,1207,1210,1213,1215,1218,1220,1223,1225,1228],{"class":450,"line":470},[448,1199,1200],{"class":851},"  const",[448,1202,1203],{"class":547}," data",[448,1205,1206],{"class":851}," =",[448,1208,1209],{"class":851}," await",[448,1211,1212],{"class":881}," useStorage",[448,1214,1183],{"class":454},[448,1216,1217],{"class":562},"\"assets:server\"",[448,1219,786],{"class":454},[448,1221,1222],{"class":881},"get",[448,1224,1183],{"class":454},[448,1226,1227],{"class":562},"\"data.json\"",[448,1229,1230],{"class":454},");\n",[448,1232,1233],{"class":450,"line":591},[448,1234,870],{"emptyLinePlaceholder":869},[448,1236,1237,1240],{"class":450,"line":604},[448,1238,1239],{"class":851},"  return",[448,1241,1242],{"class":454}," data;\n",[448,1244,1245],{"class":450,"line":615},[448,1246,940],{"class":454},[475,1248,1250],{"id":1249},"custom-server-assets","Custom Server Assets",[408,1252,1253,1254,432],{},"In order to add assets from a custom directory, you will need to define a path in your nitro config. This allows you to add assets from a directory outside of the ",[429,1255,1116],{},[408,1257,1258,1259,1262],{},"Each entry in ",[429,1260,1261],{},"serverAssets"," supports the following properties:",[774,1264,1265,1274,1280,1289],{},[777,1266,1267,1270,1271,786],{},[429,1268,1269],{},"baseName"," -- Name used as the storage mount point (accessed via ",[429,1272,1273],{},"assets:\u003CbaseName>",[777,1275,1276,782,1278,786],{},[429,1277,781],{},[429,1279,785],{},[777,1281,1282,1285,1286,786],{},[429,1283,1284],{},"pattern"," -- Glob pattern for file inclusion (default: ",[429,1287,1288],{},"\"**/*\"",[777,1290,1291,1293],{},[429,1292,831],{}," -- Array of glob patterns to exclude files.",[440,1295,1297],{"className":841,"code":1296,"filename":843,"language":844,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  serverAssets: [\n    {\n      baseName: \"templates\",\n      dir: \"./templates\",\n    },\n  ],\n});\n",[429,1298,1299,1311,1315,1325,1330,1334,1344,1353,1357,1361],{"__ignoreMap":5},[448,1300,1301,1303,1305,1307,1309],{"class":450,"line":451},[448,1302,852],{"class":851},[448,1304,855],{"class":454},[448,1306,858],{"class":851},[448,1308,861],{"class":562},[448,1310,864],{"class":454},[448,1312,1313],{"class":450,"line":458},[448,1314,870],{"emptyLinePlaceholder":869},[448,1316,1317,1319,1321,1323],{"class":450,"line":464},[448,1318,875],{"class":851},[448,1320,878],{"class":851},[448,1322,882],{"class":881},[448,1324,885],{"class":454},[448,1326,1327],{"class":450,"line":470},[448,1328,1329],{"class":454},"  serverAssets: [\n",[448,1331,1332],{"class":450,"line":591},[448,1333,895],{"class":454},[448,1335,1336,1339,1342],{"class":450,"line":604},[448,1337,1338],{"class":454},"      baseName: ",[448,1340,1341],{"class":562},"\"templates\"",[448,1343,566],{"class":454},[448,1345,1346,1348,1351],{"class":450,"line":615},[448,1347,910],{"class":454},[448,1349,1350],{"class":562},"\"./templates\"",[448,1352,566],{"class":454},[448,1354,1355],{"class":450,"line":621},[448,1356,930],{"class":454},[448,1358,1359],{"class":450,"line":629},[448,1360,935],{"class":454},[448,1362,1363],{"class":450,"line":641},[448,1364,940],{"class":454},[408,1366,1367,1368,1371],{},"Then you can use the ",[429,1369,1370],{},"assets:templates"," base to retrieve your assets.",[440,1373,1378],{"className":1374,"code":1375,"filename":1376,"language":1377,"meta":5,"style":5},"language-ts shiki shiki-themes github-light github-dark github-dark","import { defineHandler } from \"nitro\";\n\nexport default defineHandler(async (event) => {\n  const html = await useStorage(\"assets:templates\").get(\"success.html\");\n\n  return html;\n});\n","handlers/success.ts","ts",[429,1379,1380,1392,1396,1422,1451,1455,1462],{"__ignoreMap":5},[448,1381,1382,1384,1386,1388,1390],{"class":450,"line":451},[448,1383,852],{"class":851},[448,1385,1161],{"class":454},[448,1387,858],{"class":851},[448,1389,861],{"class":562},[448,1391,864],{"class":454},[448,1393,1394],{"class":450,"line":458},[448,1395,870],{"emptyLinePlaceholder":869},[448,1397,1398,1400,1402,1404,1406,1408,1411,1415,1418,1420],{"class":450,"line":464},[448,1399,875],{"class":851},[448,1401,878],{"class":851},[448,1403,1180],{"class":881},[448,1405,1183],{"class":454},[448,1407,1186],{"class":851},[448,1409,1410],{"class":454}," (",[448,1412,1414],{"class":1413},"sQHwn","event",[448,1416,1417],{"class":454},") ",[448,1419,1192],{"class":851},[448,1421,1195],{"class":454},[448,1423,1424,1426,1429,1431,1433,1435,1437,1440,1442,1444,1446,1449],{"class":450,"line":470},[448,1425,1200],{"class":851},[448,1427,1428],{"class":547}," html",[448,1430,1206],{"class":851},[448,1432,1209],{"class":851},[448,1434,1212],{"class":881},[448,1436,1183],{"class":454},[448,1438,1439],{"class":562},"\"assets:templates\"",[448,1441,786],{"class":454},[448,1443,1222],{"class":881},[448,1445,1183],{"class":454},[448,1447,1448],{"class":562},"\"success.html\"",[448,1450,1230],{"class":454},[448,1452,1453],{"class":450,"line":591},[448,1454,870],{"emptyLinePlaceholder":869},[448,1456,1457,1459],{"class":450,"line":604},[448,1458,1239],{"class":851},[448,1460,1461],{"class":454}," html;\n",[448,1463,1464],{"class":450,"line":615},[448,1465,940],{"class":454},[1123,1467,1468],{},[408,1469,1470,1471,1474],{},"\nDuring development, server assets are read directly from the filesystem using the ",[429,1472,1473],{},"fs"," unstorage driver. In production, they are bundled into the server as lazy imports with pre-computed metadata (MIME type, ETag, modification time).",[1476,1477,1478],"style",{},"html pre.shiki code .slsVL, html code.shiki .slsVL{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}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 .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 .suiK_, html code.shiki .suiK_{--shiki-light:#005CC5;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}html pre.shiki code .sQHwn, html code.shiki .sQHwn{--shiki-light:#E36209;--shiki-default:#FFAB70;--shiki-dark:#FFAB70}",{"title":5,"searchDepth":458,"depth":458,"links":1480},[1481,1487],{"id":423,"depth":458,"text":424,"children":1482},[1483,1484,1485,1486],{"id":477,"depth":464,"text":478},{"id":519,"depth":464,"text":520},{"id":764,"depth":464,"text":765},{"id":953,"depth":464,"text":954},{"id":1110,"depth":458,"text":1111,"children":1488},[1489],{"id":1249,"depth":464,"text":1250},{"icon":31},{"icon":31},{"title":28,"description":5},"vWvIwkVaPjjGhzBVM1nmEBjGTrgr6J0Kn5K3rDJGa4A",[1495,1497],{"title":23,"path":24,"stem":25,"description":1496,"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.",{"title":33,"path":34,"stem":35,"description":1498,"icon":36,"children":-1},"Customize and extend Nitro defaults.",1776373821996]