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