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