[{"data":1,"prerenderedAt":1492},["ShallowReactive",2],{"navigation":3,"-docs-assets":394,"-docs-assets-surround":1487},[4,88,217,223,379,391],{"title":5,"path":6,"stem":7,"children":8,"icon":87},"","/docs","1.docs/1.index",[9,12,17,22,27,32,37,42,47,52,57,62,67,72,77,82],{"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},"Server Entry","/docs/server-entry","1.docs/6.server-entry","ri:server-line",{"title":68,"path":69,"stem":70,"icon":71},"Cache","/docs/cache","1.docs/7.cache","ri:speed-line",{"title":73,"path":74,"stem":75,"icon":76},"KV Storage","/docs/storage","1.docs/8.storage","carbon:datastore",{"title":78,"path":79,"stem":80,"icon":81},"Migration Guide","/docs/migration","1.docs/99.migration","ri:arrow-right-up-line",{"title":83,"path":84,"stem":85,"icon":86},"Nightly Channel","/docs/nightly","1.docs/99.nightly","ri:moon-fill","i-lucide-book-open",{"title":89,"path":90,"stem":91,"children":92,"icon":94},"Deploy","/deploy","2.deploy/0.index",[93,95,116],{"title":89,"path":90,"stem":91,"icon":94},"ri:upload-cloud-2-line",{"title":96,"path":97,"stem":98,"children":99,"page":115},"Runtimes","/deploy/runtimes","2.deploy/10.runtimes",[100,105,110],{"title":101,"path":102,"stem":103,"icon":104},"Node.js","/deploy/runtimes/node","2.deploy/10.runtimes/1.node","akar-icons:node-fill",{"title":106,"path":107,"stem":108,"icon":109},"Bun","/deploy/runtimes/bun","2.deploy/10.runtimes/bun","simple-icons:bun",{"title":111,"path":112,"stem":113,"icon":114},"Deno","/deploy/runtimes/deno","2.deploy/10.runtimes/deno","simple-icons:deno",false,{"title":117,"path":118,"stem":119,"children":120,"page":115},"Providers","/deploy/providers","2.deploy/20.providers",[121,125,129,133,137,141,145,149,153,157,161,165,169,173,177,181,185,189,193,197,201,205,209,213],{"title":122,"path":123,"stem":124},"Alwaysdata","/deploy/providers/alwaysdata","2.deploy/20.providers/alwaysdata",{"title":126,"path":127,"stem":128},"AWS Lambda","/deploy/providers/aws","2.deploy/20.providers/aws",{"title":130,"path":131,"stem":132},"AWS Amplify","/deploy/providers/aws-amplify","2.deploy/20.providers/aws-amplify",{"title":134,"path":135,"stem":136},"Azure","/deploy/providers/azure","2.deploy/20.providers/azure",{"title":138,"path":139,"stem":140},"Cleavr","/deploy/providers/cleavr","2.deploy/20.providers/cleavr",{"title":142,"path":143,"stem":144},"Cloudflare","/deploy/providers/cloudflare","2.deploy/20.providers/cloudflare",{"title":146,"path":147,"stem":148},"Deno Deploy","/deploy/providers/deno-deploy","2.deploy/20.providers/deno-deploy",{"title":150,"path":151,"stem":152},"DigitalOcean","/deploy/providers/digitalocean","2.deploy/20.providers/digitalocean",{"title":154,"path":155,"stem":156},"Firebase","/deploy/providers/firebase","2.deploy/20.providers/firebase",{"title":158,"path":159,"stem":160},"Flightcontrol","/deploy/providers/flightcontrol","2.deploy/20.providers/flightcontrol",{"title":162,"path":163,"stem":164},"Genezio","/deploy/providers/genezio","2.deploy/20.providers/genezio",{"title":166,"path":167,"stem":168},"GitHub Pages","/deploy/providers/github-pages","2.deploy/20.providers/github-pages",{"title":170,"path":171,"stem":172},"GitLab Pages","/deploy/providers/gitlab-pages","2.deploy/20.providers/gitlab-pages",{"title":174,"path":175,"stem":176},"Heroku","/deploy/providers/heroku","2.deploy/20.providers/heroku",{"title":178,"path":179,"stem":180},"IIS","/deploy/providers/iis","2.deploy/20.providers/iis",{"title":182,"path":183,"stem":184},"Koyeb","/deploy/providers/koyeb","2.deploy/20.providers/koyeb",{"title":186,"path":187,"stem":188},"Netlify","/deploy/providers/netlify","2.deploy/20.providers/netlify",{"title":190,"path":191,"stem":192},"Platform.sh","/deploy/providers/platform-sh","2.deploy/20.providers/platform-sh",{"title":194,"path":195,"stem":196},"Render.com","/deploy/providers/render","2.deploy/20.providers/render",{"title":198,"path":199,"stem":200},"StormKit","/deploy/providers/stormkit","2.deploy/20.providers/stormkit",{"title":202,"path":203,"stem":204},"Vercel","/deploy/providers/vercel","2.deploy/20.providers/vercel",{"title":206,"path":207,"stem":208},"Zeabur","/deploy/providers/zeabur","2.deploy/20.providers/zeabur",{"title":210,"path":211,"stem":212},"Zephyr Cloud","/deploy/providers/zephyr","2.deploy/20.providers/zephyr",{"title":214,"path":215,"stem":216},"Zerops","/deploy/providers/zerops","2.deploy/20.providers/zerops",{"title":218,"path":219,"stem":220,"children":221,"icon":36},"Config","/config","3.config/0.index",[222],{"title":218,"path":219,"stem":220,"icon":36},{"title":224,"path":225,"stem":226,"children":227,"icon":229},"Examples","/examples","4.examples/0.index",[228,230,235,240,245,250,254,259,264,269,274,279,284,288,293,297,301,306,311,316,321,326,331,336,341,346,350,355,360,364,369,374],{"title":224,"path":225,"stem":226,"icon":229},"i-lucide-folder-code",{"title":231,"path":232,"stem":233,"icon":234},"API Routes","/examples/api-routes","4.examples/api-routes","i-lucide-route",{"title":236,"path":237,"stem":238,"icon":239},"Auto Imports","/examples/auto-imports","4.examples/auto-imports","i-lucide-import",{"title":241,"path":242,"stem":243,"icon":244},"Cached Handler","/examples/cached-handler","4.examples/cached-handler","i-lucide-clock",{"title":246,"path":247,"stem":248,"icon":249},"Custom Error Handler","/examples/custom-error-handler","4.examples/custom-error-handler","i-lucide-alert-circle",{"title":38,"path":251,"stem":252,"icon":253},"/examples/database","4.examples/database","i-lucide-database",{"title":255,"path":256,"stem":257,"icon":258},"Elysia","/examples/elysia","4.examples/elysia","i-skill-icons-elysia-dark",{"title":260,"path":261,"stem":262,"icon":263},"Express","/examples/express","4.examples/express","i-simple-icons-express",{"title":265,"path":266,"stem":267,"icon":268},"Fastify","/examples/fastify","4.examples/fastify","i-simple-icons-fastify",{"title":270,"path":271,"stem":272,"icon":273},"Hello World","/examples/hello-world","4.examples/hello-world","i-lucide-sparkles",{"title":275,"path":276,"stem":277,"icon":278},"Hono","/examples/hono","4.examples/hono","i-logos-hono",{"title":280,"path":281,"stem":282,"icon":283},"Import Alias","/examples/import-alias","4.examples/import-alias","i-lucide-at-sign",{"title":285,"path":286,"stem":287,"icon":46},"Middleware","/examples/middleware","4.examples/middleware",{"title":289,"path":290,"stem":291,"icon":292},"Mono JSX","/examples/mono-jsx","4.examples/mono-jsx","i-lucide-brackets",{"title":294,"path":295,"stem":296,"icon":292},"Nano JSX","/examples/nano-jsx","4.examples/nano-jsx",{"title":53,"path":298,"stem":299,"icon":300},"/examples/plugins","4.examples/plugins","i-lucide-plug",{"title":302,"path":303,"stem":304,"icon":305},"Custom Renderer","/examples/renderer","4.examples/renderer","i-lucide-code",{"title":307,"path":308,"stem":309,"icon":310},"Runtime Config","/examples/runtime-config","4.examples/runtime-config","i-lucide-settings",{"title":312,"path":313,"stem":314,"icon":315},"Server Fetch","/examples/server-fetch","4.examples/server-fetch","i-lucide-arrow-right-left",{"title":317,"path":318,"stem":319,"icon":320},"Shiki","/examples/shiki","4.examples/shiki","i-lucide-highlighter",{"title":322,"path":323,"stem":324,"icon":325},"Virtual Routes","/examples/virtual-routes","4.examples/virtual-routes","i-lucide-box",{"title":327,"path":328,"stem":329,"icon":330},"Vite Nitro Plugin","/examples/vite-nitro-plugin","4.examples/vite-nitro-plugin","i-logos-vitejs",{"title":332,"path":333,"stem":334,"icon":335},"Vite RSC","/examples/vite-rsc","4.examples/vite-rsc","i-logos-react",{"title":337,"path":338,"stem":339,"icon":340},"Vite SSR HTML","/examples/vite-ssr-html","4.examples/vite-ssr-html","i-logos-html-5",{"title":342,"path":343,"stem":344,"icon":345},"SSR with Preact","/examples/vite-ssr-preact","4.examples/vite-ssr-preact","i-logos-preact",{"title":347,"path":348,"stem":349,"icon":335},"SSR with React","/examples/vite-ssr-react","4.examples/vite-ssr-react",{"title":351,"path":352,"stem":353,"icon":354},"SSR with SolidJS","/examples/vite-ssr-solid","4.examples/vite-ssr-solid","i-logos-solidjs-icon",{"title":356,"path":357,"stem":358,"icon":359},"SSR with TanStack Router","/examples/vite-ssr-tsr-react","4.examples/vite-ssr-tsr-react","i-simple-icons-tanstack",{"title":361,"path":362,"stem":363,"icon":359},"SSR with TanStack Start","/examples/vite-ssr-tss-react","4.examples/vite-ssr-tss-react",{"title":365,"path":366,"stem":367,"icon":368},"SSR with Vue Router","/examples/vite-ssr-vue-router","4.examples/vite-ssr-vue-router","i-logos-vue",{"title":370,"path":371,"stem":372,"icon":373},"Vite + tRPC","/examples/vite-trpc","4.examples/vite-trpc","i-simple-icons-trpc",{"title":375,"path":376,"stem":377,"icon":378},"WebSocket","/examples/websocket","4.examples/websocket","i-lucide-radio",{"title":380,"path":381,"stem":382,"children":383},"Blog","/blog","9.blog",[384,387],{"title":380,"path":381,"stem":385,"icon":386},"9.blog/index","i-lucide-file-text",{"title":388,"path":389,"stem":390,"icon":386},"Nitro v3 Beta is here!","/blog/v3-beta","9.blog/1.v3-beta",{"title":5,"path":392,"stem":393},"/","index",{"id":395,"title":28,"body":396,"description":5,"extension":436,"meta":1483,"navigation":1484,"path":29,"seo":1485,"stem":30,"__hash__":1486},"content/1.docs/50.assets.md",{"type":397,"value":398,"toc":1472,"icon":31},"minimark",[399,412,417,425,431,466,471,494,509,513,523,751,754,758,765,831,933,943,947,965,972,1016,1019,1090,1100,1104,1114,1124,1135,1142,1240,1244,1249,1256,1287,1358,1365,1459,1468],[400,401,402,403,407,408,411],"p",{},"Nitro supports two types of assets: ",[404,405,406],"strong",{},"public assets"," served directly to clients and ",[404,409,410],{},"server assets"," bundled into the server for programmatic access.",[413,414,416],"h2",{"id":415},"public-assets","Public Assets",[400,418,419,420,424],{},"Nitro handles assets via the ",[421,422,423],"code",{},"public/"," directory.",[400,426,427,428,430],{},"All assets in ",[421,429,423],{}," directory will be automatically served. This means that you can access them directly from the browser without any special configuration.",[432,433,437],"pre",{"className":434,"code":435,"language":436,"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",[421,438,439,448,454,460],{"__ignoreMap":5},[440,441,444],"span",{"class":442,"line":443},"line",1,[440,445,447],{"class":446},"slsVL","public/\n",[440,449,451],{"class":442,"line":450},2,[440,452,453],{"class":446},"  image.png     \u003C-- /image.png\n",[440,455,457],{"class":442,"line":456},3,[440,458,459],{"class":446},"  video.mp4     \u003C-- /video.mp4\n",[440,461,463],{"class":442,"line":462},4,[440,464,465],{"class":446},"  robots.txt    \u003C-- /robots.txt\n",[467,468,470],"h3",{"id":469},"caching-and-headers","Caching and Headers",[400,472,473,474,477,478,481,482,485,486,489,490,493],{},"Public assets are served with automatic ",[421,475,476],{},"ETag"," and ",[421,479,480],{},"Last-Modified"," headers for conditional requests. When the client sends ",[421,483,484],{},"If-None-Match"," or ",[421,487,488],{},"If-Modified-Since"," headers, Nitro returns a ",[421,491,492],{},"304 Not Modified"," response.",[400,495,496,497,500,501,504,505,508],{},"For assets served from a non-root ",[421,498,499],{},"baseURL"," (such as ",[421,502,503],{},"/build/","), Nitro prevents fallthrough to application handlers. If a request matches a public asset base but the file is not found, a ",[421,506,507],{},"404"," is returned immediately.",[467,510,512],{"id":511},"production-public-assets","Production Public Assets",[400,514,515,516,518,519,522],{},"When building your Nitro app, the ",[421,517,423],{}," directory will be copied to ",[421,520,521],{},".output/public/"," and a manifest with metadata will be created and embedded in the server bundle.",[432,524,528],{"className":525,"code":526,"language":527,"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",[421,529,530,535,544,559,581,594,605,611,619,631,651,662,672,677,685,697,717,729,739,745],{"__ignoreMap":5},[440,531,532],{"class":442,"line":443},[440,533,534],{"class":446},"{\n",[440,536,537,541],{"class":442,"line":450},[440,538,540],{"class":539},"suiK_","  \"/image.png\"",[440,542,543],{"class":446},": {\n",[440,545,546,549,552,556],{"class":442,"line":456},[440,547,548],{"class":539},"    \"type\"",[440,550,551],{"class":446},": ",[440,553,555],{"class":554},"sfrk1","\"image/png\"",[440,557,558],{"class":446},",\n",[440,560,561,564,566,569,572,575,577,579],{"class":442,"line":462},[440,562,563],{"class":539},"    \"etag\"",[440,565,551],{"class":446},[440,567,568],{"class":554},"\"",[440,570,571],{"class":539},"\\\"",[440,573,574],{"class":554},"4a0c-6utWq0Kbk5OqDmksYCa9XV8irnM",[440,576,571],{"class":539},[440,578,568],{"class":554},[440,580,558],{"class":446},[440,582,584,587,589,592],{"class":442,"line":583},5,[440,585,586],{"class":539},"    \"mtime\"",[440,588,551],{"class":446},[440,590,591],{"class":554},"\"2023-03-04T21:39:45.086Z\"",[440,593,558],{"class":446},[440,595,597,600,602],{"class":442,"line":596},6,[440,598,599],{"class":539},"    \"size\"",[440,601,551],{"class":446},[440,603,604],{"class":539},"18956\n",[440,606,608],{"class":442,"line":607},7,[440,609,610],{"class":446},"  },\n",[440,612,614,617],{"class":442,"line":613},8,[440,615,616],{"class":539},"  \"/robots.txt\"",[440,618,543],{"class":446},[440,620,622,624,626,629],{"class":442,"line":621},9,[440,623,548],{"class":539},[440,625,551],{"class":446},[440,627,628],{"class":554},"\"text/plain; charset=utf-8\"",[440,630,558],{"class":446},[440,632,634,636,638,640,642,645,647,649],{"class":442,"line":633},10,[440,635,563],{"class":539},[440,637,551],{"class":446},[440,639,568],{"class":554},[440,641,571],{"class":539},[440,643,644],{"class":554},"8-hMqyDrA8fJ0R904zgEPs3L55Jls",[440,646,571],{"class":539},[440,648,568],{"class":554},[440,650,558],{"class":446},[440,652,654,656,658,660],{"class":442,"line":653},11,[440,655,586],{"class":539},[440,657,551],{"class":446},[440,659,591],{"class":554},[440,661,558],{"class":446},[440,663,665,667,669],{"class":442,"line":664},12,[440,666,599],{"class":539},[440,668,551],{"class":446},[440,670,671],{"class":539},"8\n",[440,673,675],{"class":442,"line":674},13,[440,676,610],{"class":446},[440,678,680,683],{"class":442,"line":679},14,[440,681,682],{"class":539},"  \"/video.mp4\"",[440,684,543],{"class":446},[440,686,688,690,692,695],{"class":442,"line":687},15,[440,689,548],{"class":539},[440,691,551],{"class":446},[440,693,694],{"class":554},"\"video/mp4\"",[440,696,558],{"class":446},[440,698,700,702,704,706,708,711,713,715],{"class":442,"line":699},16,[440,701,563],{"class":539},[440,703,551],{"class":446},[440,705,568],{"class":554},[440,707,571],{"class":539},[440,709,710],{"class":554},"9b943-4UwfQXKUjPCesGPr6J5j7GzNYGU",[440,712,571],{"class":539},[440,714,568],{"class":554},[440,716,558],{"class":446},[440,718,720,722,724,727],{"class":442,"line":719},17,[440,721,586],{"class":539},[440,723,551],{"class":446},[440,725,726],{"class":554},"\"2023-03-04T21:39:45.085Z\"",[440,728,558],{"class":446},[440,730,732,734,736],{"class":442,"line":731},18,[440,733,599],{"class":539},[440,735,551],{"class":446},[440,737,738],{"class":539},"637251\n",[440,740,742],{"class":442,"line":741},19,[440,743,744],{"class":446},"  }\n",[440,746,748],{"class":442,"line":747},20,[440,749,750],{"class":446},"}\n",[400,752,753],{},"This allows Nitro to know the public assets without scanning the directory, giving high performance with caching headers.",[467,755,757],{"id":756},"custom-public-asset-directories","Custom Public Asset Directories",[400,759,760,761,764],{},"You can configure additional public asset directories using the ",[421,762,763],{},"publicAssets"," config option. Each entry supports the following properties:",[766,767,768,779,787,801,819],"ul",{},[769,770,771,774,775,778],"li",{},[421,772,773],{},"dir"," -- Path to the directory (resolved relative to ",[421,776,777],{},"rootDir",").",[769,780,781,783,784,778],{},[421,782,499],{}," -- URL prefix for serving assets (default: ",[421,785,786],{},"\"/\"",[769,788,789,792,793,796,797,800],{},[421,790,791],{},"maxAge"," -- Cache ",[421,794,795],{},"max-age"," in seconds. When set, a ",[421,798,799],{},"Cache-Control: public, max-age=\u003Cvalue>, immutable"," header is applied via route rules.",[769,802,803,806,807,810,811,814,815,818],{},[421,804,805],{},"fallthrough"," -- Whether requests should fall through to application handlers when the asset is not found. Top-level (",[421,808,809],{},"baseURL: \"/\"",") directories default to ",[421,812,813],{},"true","; non-root directories default to ",[421,816,817],{},"false",".",[769,820,821,824,825,827,828,830],{},[421,822,823],{},"ignore"," -- Pass ",[421,826,817],{}," to disable ignore patterns, or an array of glob patterns to override the global ",[421,829,823],{}," option.",[432,832,837],{"className":833,"code":834,"filename":835,"language":836,"meta":5,"style":5},"language-js shiki shiki-themes github-light github-dark github-dark","import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  publicAssets: [\n    {\n      baseURL: \"build\",\n      dir: \"public/build\",\n      maxAge: 3600,\n    },\n  ],\n});\n","nitro.config.ts","js",[421,838,839,857,863,878,883,888,898,908,918,923,928],{"__ignoreMap":5},[440,840,841,845,848,851,854],{"class":442,"line":443},[440,842,844],{"class":843},"so5gQ","import",[440,846,847],{"class":446}," { defineNitroConfig } ",[440,849,850],{"class":843},"from",[440,852,853],{"class":554}," \"nitro/config\"",[440,855,856],{"class":446},";\n",[440,858,859],{"class":442,"line":450},[440,860,862],{"emptyLinePlaceholder":861},true,"\n",[440,864,865,868,871,875],{"class":442,"line":456},[440,866,867],{"class":843},"export",[440,869,870],{"class":843}," default",[440,872,874],{"class":873},"shcOC"," defineNitroConfig",[440,876,877],{"class":446},"({\n",[440,879,880],{"class":442,"line":462},[440,881,882],{"class":446},"  publicAssets: [\n",[440,884,885],{"class":442,"line":583},[440,886,887],{"class":446},"    {\n",[440,889,890,893,896],{"class":442,"line":596},[440,891,892],{"class":446},"      baseURL: ",[440,894,895],{"class":554},"\"build\"",[440,897,558],{"class":446},[440,899,900,903,906],{"class":442,"line":607},[440,901,902],{"class":446},"      dir: ",[440,904,905],{"class":554},"\"public/build\"",[440,907,558],{"class":446},[440,909,910,913,916],{"class":442,"line":613},[440,911,912],{"class":446},"      maxAge: ",[440,914,915],{"class":539},"3600",[440,917,558],{"class":446},[440,919,920],{"class":442,"line":621},[440,921,922],{"class":446},"    },\n",[440,924,925],{"class":442,"line":633},[440,926,927],{"class":446},"  ],\n",[440,929,930],{"class":442,"line":653},[440,931,932],{"class":446},"});\n",[400,934,935,936,939,940,942],{},"In this example, files in ",[421,937,938],{},"public/build/"," are served under ",[421,941,503],{}," with a one-hour cache and no fallthrough to application handlers.",[467,944,946],{"id":945},"compressed-public-assets","Compressed Public Assets",[400,948,949,950,953,954,957,958,961,962,778],{},"Nitro can generate pre-compressed versions of your public assets during the build. When a client sends an ",[421,951,952],{},"Accept-Encoding"," header, the server will serve the compressed version if available. Supported encodings are gzip (",[421,955,956],{},".gz","), brotli (",[421,959,960],{},".br","), and zstd (",[421,963,964],{},".zst",[400,966,967,968,971],{},"Set ",[421,969,970],{},"compressPublicAssets: true"," to enable all encodings:",[432,973,975],{"className":833,"code":974,"filename":835,"language":836,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  compressPublicAssets: true,\n});\n",[421,976,977,989,993,1003,1012],{"__ignoreMap":5},[440,978,979,981,983,985,987],{"class":442,"line":443},[440,980,844],{"class":843},[440,982,847],{"class":446},[440,984,850],{"class":843},[440,986,853],{"class":554},[440,988,856],{"class":446},[440,990,991],{"class":442,"line":450},[440,992,862],{"emptyLinePlaceholder":861},[440,994,995,997,999,1001],{"class":442,"line":456},[440,996,867],{"class":843},[440,998,870],{"class":843},[440,1000,874],{"class":873},[440,1002,877],{"class":446},[440,1004,1005,1008,1010],{"class":442,"line":462},[440,1006,1007],{"class":446},"  compressPublicAssets: ",[440,1009,813],{"class":539},[440,1011,558],{"class":446},[440,1013,1014],{"class":442,"line":583},[440,1015,932],{"class":446},[400,1017,1018],{},"Or pick specific encodings:",[432,1020,1022],{"className":833,"code":1021,"filename":835,"language":836,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  compressPublicAssets: {\n    gzip: true,\n    brotli: true,\n    zstd: false,\n  },\n});\n",[421,1023,1024,1036,1040,1050,1055,1064,1073,1082,1086],{"__ignoreMap":5},[440,1025,1026,1028,1030,1032,1034],{"class":442,"line":443},[440,1027,844],{"class":843},[440,1029,847],{"class":446},[440,1031,850],{"class":843},[440,1033,853],{"class":554},[440,1035,856],{"class":446},[440,1037,1038],{"class":442,"line":450},[440,1039,862],{"emptyLinePlaceholder":861},[440,1041,1042,1044,1046,1048],{"class":442,"line":456},[440,1043,867],{"class":843},[440,1045,870],{"class":843},[440,1047,874],{"class":873},[440,1049,877],{"class":446},[440,1051,1052],{"class":442,"line":462},[440,1053,1054],{"class":446},"  compressPublicAssets: {\n",[440,1056,1057,1060,1062],{"class":442,"line":583},[440,1058,1059],{"class":446},"    gzip: ",[440,1061,813],{"class":539},[440,1063,558],{"class":446},[440,1065,1066,1069,1071],{"class":442,"line":596},[440,1067,1068],{"class":446},"    brotli: ",[440,1070,813],{"class":539},[440,1072,558],{"class":446},[440,1074,1075,1078,1080],{"class":442,"line":607},[440,1076,1077],{"class":446},"    zstd: ",[440,1079,817],{"class":539},[440,1081,558],{"class":446},[440,1083,1084],{"class":442,"line":613},[440,1085,610],{"class":446},[440,1087,1088],{"class":442,"line":621},[440,1089,932],{"class":446},[1091,1092,1093],"note",{},[400,1094,1095,1096,1099],{},"\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 (",[421,1097,1098],{},".map",") are excluded.",[413,1101,1103],{"id":1102},"server-assets","Server Assets",[400,1105,427,1106,1109,1110,1113],{},[421,1107,1108],{},"assets/"," directory will be added to the server bundle. After building your application, you can find them in the ",[421,1111,1112],{},".output/server/chunks/raw/"," directory. Be careful with the size of your assets, as they will be bundled with the server bundle.",[1115,1116,1117],"tip",{},[400,1118,1119,1120,1123],{},"\nUnless using ",[421,1121,1122],{},"useStorage()",", assets won't be included in the server bundle.",[400,1125,1126,1127,1130,1131,818],{},"They can be addressed by the ",[421,1128,1129],{},"assets:server"," mount point using the ",[1132,1133,1134],"a",{"href":74},"storage layer",[400,1136,1137,1138,1141],{},"For example, you could store a json file in ",[421,1139,1140],{},"assets/data.json"," and retrieve it in your handler:",[432,1143,1145],{"className":833,"code":1144,"language":836,"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",[421,1146,1147,1161,1165,1189,1224,1228,1236],{"__ignoreMap":5},[440,1148,1149,1151,1154,1156,1159],{"class":442,"line":443},[440,1150,844],{"class":843},[440,1152,1153],{"class":446}," { defineHandler } ",[440,1155,850],{"class":843},[440,1157,1158],{"class":554}," \"nitro\"",[440,1160,856],{"class":446},[440,1162,1163],{"class":442,"line":450},[440,1164,862],{"emptyLinePlaceholder":861},[440,1166,1167,1169,1171,1174,1177,1180,1183,1186],{"class":442,"line":456},[440,1168,867],{"class":843},[440,1170,870],{"class":843},[440,1172,1173],{"class":873}," defineHandler",[440,1175,1176],{"class":446},"(",[440,1178,1179],{"class":843},"async",[440,1181,1182],{"class":446}," () ",[440,1184,1185],{"class":843},"=>",[440,1187,1188],{"class":446}," {\n",[440,1190,1191,1194,1197,1200,1203,1206,1208,1211,1213,1216,1218,1221],{"class":442,"line":462},[440,1192,1193],{"class":843},"  const",[440,1195,1196],{"class":539}," data",[440,1198,1199],{"class":843}," =",[440,1201,1202],{"class":843}," await",[440,1204,1205],{"class":873}," useStorage",[440,1207,1176],{"class":446},[440,1209,1210],{"class":554},"\"assets:server\"",[440,1212,778],{"class":446},[440,1214,1215],{"class":873},"get",[440,1217,1176],{"class":446},[440,1219,1220],{"class":554},"\"data.json\"",[440,1222,1223],{"class":446},");\n",[440,1225,1226],{"class":442,"line":583},[440,1227,862],{"emptyLinePlaceholder":861},[440,1229,1230,1233],{"class":442,"line":596},[440,1231,1232],{"class":843},"  return",[440,1234,1235],{"class":446}," data;\n",[440,1237,1238],{"class":442,"line":607},[440,1239,932],{"class":446},[467,1241,1243],{"id":1242},"custom-server-assets","Custom Server Assets",[400,1245,1246,1247,424],{},"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 ",[421,1248,1108],{},[400,1250,1251,1252,1255],{},"Each entry in ",[421,1253,1254],{},"serverAssets"," supports the following properties:",[766,1257,1258,1267,1273,1282],{},[769,1259,1260,1263,1264,778],{},[421,1261,1262],{},"baseName"," -- Name used as the storage mount point (accessed via ",[421,1265,1266],{},"assets:\u003CbaseName>",[769,1268,1269,774,1271,778],{},[421,1270,773],{},[421,1272,777],{},[769,1274,1275,1278,1279,778],{},[421,1276,1277],{},"pattern"," -- Glob pattern for file inclusion (default: ",[421,1280,1281],{},"\"**/*\"",[769,1283,1284,1286],{},[421,1285,823],{}," -- Array of glob patterns to exclude files.",[432,1288,1290],{"className":833,"code":1289,"filename":835,"language":836,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  serverAssets: [\n    {\n      baseName: \"templates\",\n      dir: \"./templates\",\n    },\n  ],\n});\n",[421,1291,1292,1304,1308,1318,1323,1327,1337,1346,1350,1354],{"__ignoreMap":5},[440,1293,1294,1296,1298,1300,1302],{"class":442,"line":443},[440,1295,844],{"class":843},[440,1297,847],{"class":446},[440,1299,850],{"class":843},[440,1301,853],{"class":554},[440,1303,856],{"class":446},[440,1305,1306],{"class":442,"line":450},[440,1307,862],{"emptyLinePlaceholder":861},[440,1309,1310,1312,1314,1316],{"class":442,"line":456},[440,1311,867],{"class":843},[440,1313,870],{"class":843},[440,1315,874],{"class":873},[440,1317,877],{"class":446},[440,1319,1320],{"class":442,"line":462},[440,1321,1322],{"class":446},"  serverAssets: [\n",[440,1324,1325],{"class":442,"line":583},[440,1326,887],{"class":446},[440,1328,1329,1332,1335],{"class":442,"line":596},[440,1330,1331],{"class":446},"      baseName: ",[440,1333,1334],{"class":554},"\"templates\"",[440,1336,558],{"class":446},[440,1338,1339,1341,1344],{"class":442,"line":607},[440,1340,902],{"class":446},[440,1342,1343],{"class":554},"\"./templates\"",[440,1345,558],{"class":446},[440,1347,1348],{"class":442,"line":613},[440,1349,922],{"class":446},[440,1351,1352],{"class":442,"line":621},[440,1353,927],{"class":446},[440,1355,1356],{"class":442,"line":633},[440,1357,932],{"class":446},[400,1359,1360,1361,1364],{},"Then you can use the ",[421,1362,1363],{},"assets:templates"," base to retrieve your assets.",[432,1366,1371],{"className":1367,"code":1368,"filename":1369,"language":1370,"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",[421,1372,1373,1385,1389,1415,1444,1448,1455],{"__ignoreMap":5},[440,1374,1375,1377,1379,1381,1383],{"class":442,"line":443},[440,1376,844],{"class":843},[440,1378,1153],{"class":446},[440,1380,850],{"class":843},[440,1382,1158],{"class":554},[440,1384,856],{"class":446},[440,1386,1387],{"class":442,"line":450},[440,1388,862],{"emptyLinePlaceholder":861},[440,1390,1391,1393,1395,1397,1399,1401,1404,1408,1411,1413],{"class":442,"line":456},[440,1392,867],{"class":843},[440,1394,870],{"class":843},[440,1396,1173],{"class":873},[440,1398,1176],{"class":446},[440,1400,1179],{"class":843},[440,1402,1403],{"class":446}," (",[440,1405,1407],{"class":1406},"sQHwn","event",[440,1409,1410],{"class":446},") ",[440,1412,1185],{"class":843},[440,1414,1188],{"class":446},[440,1416,1417,1419,1422,1424,1426,1428,1430,1433,1435,1437,1439,1442],{"class":442,"line":462},[440,1418,1193],{"class":843},[440,1420,1421],{"class":539}," html",[440,1423,1199],{"class":843},[440,1425,1202],{"class":843},[440,1427,1205],{"class":873},[440,1429,1176],{"class":446},[440,1431,1432],{"class":554},"\"assets:templates\"",[440,1434,778],{"class":446},[440,1436,1215],{"class":873},[440,1438,1176],{"class":446},[440,1440,1441],{"class":554},"\"success.html\"",[440,1443,1223],{"class":446},[440,1445,1446],{"class":442,"line":583},[440,1447,862],{"emptyLinePlaceholder":861},[440,1449,1450,1452],{"class":442,"line":596},[440,1451,1232],{"class":843},[440,1453,1454],{"class":446}," html;\n",[440,1456,1457],{"class":442,"line":607},[440,1458,932],{"class":446},[1115,1460,1461],{},[400,1462,1463,1464,1467],{},"\nDuring development, server assets are read directly from the filesystem using the ",[421,1465,1466],{},"fs"," unstorage driver. In production, they are bundled into the server as lazy imports with pre-computed metadata (MIME type, ETag, modification time).",[1469,1470,1471],"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":450,"depth":450,"links":1473},[1474,1480],{"id":415,"depth":450,"text":416,"children":1475},[1476,1477,1478,1479],{"id":469,"depth":456,"text":470},{"id":511,"depth":456,"text":512},{"id":756,"depth":456,"text":757},{"id":945,"depth":456,"text":946},{"id":1102,"depth":450,"text":1103,"children":1481},[1482],{"id":1242,"depth":456,"text":1243},{"icon":31},{"icon":31},{"title":28,"description":5},"ll5E3exTMPR14DSxMM6YstO6gZFjPziSofxPBjUzbW0",[1488,1490],{"title":23,"path":24,"stem":25,"description":1489,"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":1491,"icon":36,"children":-1},"Customize and extend Nitro defaults.",1775834858592]