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