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