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