[{"data":1,"prerenderedAt":1745},["ShallowReactive",2],{"navigation":3,"-docs-configuration":389,"-docs-configuration-surround":1741},[4,83,212,218,374,386],{"title":5,"path":6,"stem":7,"children":8,"icon":82},"","/docs","1.docs/1.index",[9,12,17,22,27,32,37,42,47,52,57,62,67,72,77],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-compass",{"title":13,"path":14,"stem":15,"icon":16},"Quick Start","/docs/quick-start","1.docs/2.quick-start","i-lucide-zap",{"title":18,"path":19,"stem":20,"icon":21},"Renderer","/docs/renderer","1.docs/4.renderer","ri:layout-masonry-line",{"title":23,"path":24,"stem":25,"icon":26},"Routing","/docs/routing","1.docs/5.routing","ri:direction-line",{"title":28,"path":29,"stem":30,"icon":31},"Assets","/docs/assets","1.docs/50.assets","ri:image-2-line",{"title":33,"path":34,"stem":35,"icon":36},"Configuration","/docs/configuration","1.docs/50.configuration","ri:settings-3-line",{"title":38,"path":39,"stem":40,"icon":41},"Database","/docs/database","1.docs/50.database","ri:database-2-line",{"title":43,"path":44,"stem":45,"icon":46},"Lifecycle","/docs/lifecycle","1.docs/50.lifecycle","i-lucide-layers",{"title":48,"path":49,"stem":50,"icon":51},"Plugins","/docs/plugins","1.docs/50.plugins","ri:plug-line",{"title":53,"path":54,"stem":55,"icon":56},"Tasks","/docs/tasks","1.docs/50.tasks","codicon:run-all",{"title":58,"path":59,"stem":60,"icon":61},"Server Entry","/docs/server-entry","1.docs/6.server-entry","ri:server-line",{"title":63,"path":64,"stem":65,"icon":66},"Cache","/docs/cache","1.docs/7.cache","ri:speed-line",{"title":68,"path":69,"stem":70,"icon":71},"KV Storage","/docs/storage","1.docs/8.storage","carbon:datastore",{"title":73,"path":74,"stem":75,"icon":76},"Migration Guide","/docs/migration","1.docs/99.migration","ri:arrow-right-up-line",{"title":78,"path":79,"stem":80,"icon":81},"Nightly Channel","/docs/nightly","1.docs/99.nightly","ri:moon-fill","i-lucide-book-open",{"title":84,"path":85,"stem":86,"children":87,"icon":89},"Deploy","/deploy","2.deploy/0.index",[88,90,111],{"title":84,"path":85,"stem":86,"icon":89},"ri:upload-cloud-2-line",{"title":91,"path":92,"stem":93,"children":94,"page":110},"Runtimes","/deploy/runtimes","2.deploy/10.runtimes",[95,100,105],{"title":96,"path":97,"stem":98,"icon":99},"Node.js","/deploy/runtimes/node","2.deploy/10.runtimes/1.node","akar-icons:node-fill",{"title":101,"path":102,"stem":103,"icon":104},"Bun","/deploy/runtimes/bun","2.deploy/10.runtimes/bun","simple-icons:bun",{"title":106,"path":107,"stem":108,"icon":109},"Deno","/deploy/runtimes/deno","2.deploy/10.runtimes/deno","simple-icons:deno",false,{"title":112,"path":113,"stem":114,"children":115,"page":110},"Providers","/deploy/providers","2.deploy/20.providers",[116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208],{"title":117,"path":118,"stem":119},"Alwaysdata","/deploy/providers/alwaysdata","2.deploy/20.providers/alwaysdata",{"title":121,"path":122,"stem":123},"AWS Lambda","/deploy/providers/aws","2.deploy/20.providers/aws",{"title":125,"path":126,"stem":127},"AWS Amplify","/deploy/providers/aws-amplify","2.deploy/20.providers/aws-amplify",{"title":129,"path":130,"stem":131},"Azure","/deploy/providers/azure","2.deploy/20.providers/azure",{"title":133,"path":134,"stem":135},"Cleavr","/deploy/providers/cleavr","2.deploy/20.providers/cleavr",{"title":137,"path":138,"stem":139},"Cloudflare","/deploy/providers/cloudflare","2.deploy/20.providers/cloudflare",{"title":141,"path":142,"stem":143},"Deno Deploy","/deploy/providers/deno-deploy","2.deploy/20.providers/deno-deploy",{"title":145,"path":146,"stem":147},"DigitalOcean","/deploy/providers/digitalocean","2.deploy/20.providers/digitalocean",{"title":149,"path":150,"stem":151},"Firebase","/deploy/providers/firebase","2.deploy/20.providers/firebase",{"title":153,"path":154,"stem":155},"Flightcontrol","/deploy/providers/flightcontrol","2.deploy/20.providers/flightcontrol",{"title":157,"path":158,"stem":159},"Genezio","/deploy/providers/genezio","2.deploy/20.providers/genezio",{"title":161,"path":162,"stem":163},"GitHub Pages","/deploy/providers/github-pages","2.deploy/20.providers/github-pages",{"title":165,"path":166,"stem":167},"GitLab Pages","/deploy/providers/gitlab-pages","2.deploy/20.providers/gitlab-pages",{"title":169,"path":170,"stem":171},"Heroku","/deploy/providers/heroku","2.deploy/20.providers/heroku",{"title":173,"path":174,"stem":175},"IIS","/deploy/providers/iis","2.deploy/20.providers/iis",{"title":177,"path":178,"stem":179},"Koyeb","/deploy/providers/koyeb","2.deploy/20.providers/koyeb",{"title":181,"path":182,"stem":183},"Netlify","/deploy/providers/netlify","2.deploy/20.providers/netlify",{"title":185,"path":186,"stem":187},"Platform.sh","/deploy/providers/platform-sh","2.deploy/20.providers/platform-sh",{"title":189,"path":190,"stem":191},"Render.com","/deploy/providers/render","2.deploy/20.providers/render",{"title":193,"path":194,"stem":195},"StormKit","/deploy/providers/stormkit","2.deploy/20.providers/stormkit",{"title":197,"path":198,"stem":199},"Vercel","/deploy/providers/vercel","2.deploy/20.providers/vercel",{"title":201,"path":202,"stem":203},"Zeabur","/deploy/providers/zeabur","2.deploy/20.providers/zeabur",{"title":205,"path":206,"stem":207},"Zephyr Cloud","/deploy/providers/zephyr","2.deploy/20.providers/zephyr",{"title":209,"path":210,"stem":211},"Zerops","/deploy/providers/zerops","2.deploy/20.providers/zerops",{"title":213,"path":214,"stem":215,"children":216,"icon":36},"Config","/config","3.config/0.index",[217],{"title":213,"path":214,"stem":215,"icon":36},{"title":219,"path":220,"stem":221,"children":222,"icon":224},"Examples","/examples","4.examples/0.index",[223,225,230,235,240,245,249,254,259,264,269,274,279,283,288,292,296,301,306,311,316,321,326,331,336,341,345,350,355,359,364,369],{"title":219,"path":220,"stem":221,"icon":224},"i-lucide-folder-code",{"title":226,"path":227,"stem":228,"icon":229},"API Routes","/examples/api-routes","4.examples/api-routes","i-lucide-route",{"title":231,"path":232,"stem":233,"icon":234},"Auto Imports","/examples/auto-imports","4.examples/auto-imports","i-lucide-import",{"title":236,"path":237,"stem":238,"icon":239},"Cached Handler","/examples/cached-handler","4.examples/cached-handler","i-lucide-clock",{"title":241,"path":242,"stem":243,"icon":244},"Custom Error Handler","/examples/custom-error-handler","4.examples/custom-error-handler","i-lucide-alert-circle",{"title":38,"path":246,"stem":247,"icon":248},"/examples/database","4.examples/database","i-lucide-database",{"title":250,"path":251,"stem":252,"icon":253},"Elysia","/examples/elysia","4.examples/elysia","i-skill-icons-elysia-dark",{"title":255,"path":256,"stem":257,"icon":258},"Express","/examples/express","4.examples/express","i-simple-icons-express",{"title":260,"path":261,"stem":262,"icon":263},"Fastify","/examples/fastify","4.examples/fastify","i-simple-icons-fastify",{"title":265,"path":266,"stem":267,"icon":268},"Hello World","/examples/hello-world","4.examples/hello-world","i-lucide-sparkles",{"title":270,"path":271,"stem":272,"icon":273},"Hono","/examples/hono","4.examples/hono","i-logos-hono",{"title":275,"path":276,"stem":277,"icon":278},"Import Alias","/examples/import-alias","4.examples/import-alias","i-lucide-at-sign",{"title":280,"path":281,"stem":282,"icon":46},"Middleware","/examples/middleware","4.examples/middleware",{"title":284,"path":285,"stem":286,"icon":287},"Mono JSX","/examples/mono-jsx","4.examples/mono-jsx","i-lucide-brackets",{"title":289,"path":290,"stem":291,"icon":287},"Nano JSX","/examples/nano-jsx","4.examples/nano-jsx",{"title":48,"path":293,"stem":294,"icon":295},"/examples/plugins","4.examples/plugins","i-lucide-plug",{"title":297,"path":298,"stem":299,"icon":300},"Custom Renderer","/examples/renderer","4.examples/renderer","i-lucide-code",{"title":302,"path":303,"stem":304,"icon":305},"Runtime Config","/examples/runtime-config","4.examples/runtime-config","i-lucide-settings",{"title":307,"path":308,"stem":309,"icon":310},"Server Fetch","/examples/server-fetch","4.examples/server-fetch","i-lucide-arrow-right-left",{"title":312,"path":313,"stem":314,"icon":315},"Shiki","/examples/shiki","4.examples/shiki","i-lucide-highlighter",{"title":317,"path":318,"stem":319,"icon":320},"Virtual Routes","/examples/virtual-routes","4.examples/virtual-routes","i-lucide-box",{"title":322,"path":323,"stem":324,"icon":325},"Vite Nitro Plugin","/examples/vite-nitro-plugin","4.examples/vite-nitro-plugin","i-logos-vitejs",{"title":327,"path":328,"stem":329,"icon":330},"Vite RSC","/examples/vite-rsc","4.examples/vite-rsc","i-logos-react",{"title":332,"path":333,"stem":334,"icon":335},"Vite SSR HTML","/examples/vite-ssr-html","4.examples/vite-ssr-html","i-logos-html-5",{"title":337,"path":338,"stem":339,"icon":340},"SSR with Preact","/examples/vite-ssr-preact","4.examples/vite-ssr-preact","i-logos-preact",{"title":342,"path":343,"stem":344,"icon":330},"SSR with React","/examples/vite-ssr-react","4.examples/vite-ssr-react",{"title":346,"path":347,"stem":348,"icon":349},"SSR with SolidJS","/examples/vite-ssr-solid","4.examples/vite-ssr-solid","i-logos-solidjs-icon",{"title":351,"path":352,"stem":353,"icon":354},"SSR with TanStack Router","/examples/vite-ssr-tsr-react","4.examples/vite-ssr-tsr-react","i-simple-icons-tanstack",{"title":356,"path":357,"stem":358,"icon":354},"SSR with TanStack Start","/examples/vite-ssr-tss-react","4.examples/vite-ssr-tss-react",{"title":360,"path":361,"stem":362,"icon":363},"SSR with Vue Router","/examples/vite-ssr-vue-router","4.examples/vite-ssr-vue-router","i-logos-vue",{"title":365,"path":366,"stem":367,"icon":368},"Vite + tRPC","/examples/vite-trpc","4.examples/vite-trpc","i-simple-icons-trpc",{"title":370,"path":371,"stem":372,"icon":373},"WebSocket","/examples/websocket","4.examples/websocket","i-lucide-radio",{"title":375,"path":376,"stem":377,"children":378},"Blog","/blog","9.blog",[379,382],{"title":375,"path":376,"stem":380,"icon":381},"9.blog/index","i-lucide-file-text",{"title":383,"path":384,"stem":385,"icon":381},"Nitro v3 Beta is here!","/blog/v3-beta","9.blog/1.v3-beta",{"title":5,"path":387,"stem":388},"/","index",{"id":390,"title":33,"body":391,"description":1735,"extension":1736,"meta":1737,"navigation":1738,"path":34,"seo":1739,"stem":35,"__hash__":1740},"content/1.docs/50.configuration.md",{"type":392,"value":393,"toc":1717,"icon":36},"minimark",[394,406,411,414,574,591,596,611,708,725,729,736,781,788,798,802,805,926,999,1012,1016,1019,1065,1069,1072,1075,1134,1140,1221,1225,1236,1340,1349,1353,1356,1370,1374,1383,1389,1404,1418,1430,1440,1444,1447,1458,1470,1473,1499,1513,1517,1527,1597,1606,1610,1617,1688,1703,1713],[395,396,397],"read-more",{"to":214},[398,399,400,401,405],"p",{},"See ",[402,403,404],"a",{"href":214},"config reference"," for available options.",[407,408,410],"h2",{"id":409},"config-file","Config file",[398,412,413],{},"You can customize your Nitro builder with a configuration file.",[415,416,417,486],"CodeGroup",{},[418,419,424],"pre",{"className":420,"code":421,"filename":422,"language":423,"meta":5,"style":5},"language-ts shiki shiki-themes github-light github-dark github-dark","import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  // Nitro options\n})\n","nitro.config.ts","ts",[425,426,427,450,457,473,480],"code",{"__ignoreMap":5},[428,429,432,436,440,443,447],"span",{"class":430,"line":431},"line",1,[428,433,435],{"class":434},"so5gQ","import",[428,437,439],{"class":438},"slsVL"," { defineNitroConfig } ",[428,441,442],{"class":434},"from",[428,444,446],{"class":445},"sfrk1"," \"nitro/config\"",[428,448,449],{"class":438},";\n",[428,451,453],{"class":430,"line":452},2,[428,454,456],{"emptyLinePlaceholder":455},true,"\n",[428,458,460,463,466,470],{"class":430,"line":459},3,[428,461,462],{"class":434},"export",[428,464,465],{"class":434}," default",[428,467,469],{"class":468},"shcOC"," defineNitroConfig",[428,471,472],{"class":438},"({\n",[428,474,476],{"class":430,"line":475},4,[428,477,479],{"class":478},"sCsY4","  // Nitro options\n",[428,481,483],{"class":430,"line":482},5,[428,484,485],{"class":438},"})\n",[418,487,490],{"className":420,"code":488,"filename":489,"language":423,"meta":5,"style":5},"import { defineConfig } from 'vite'\nimport { nitro } from 'nitro/vite'\n\nexport default defineConfig({\n  plugins: [\n    nitro()\n  ],\n  nitro: {\n    // Nitro options\n  }\n})\n\n","vite.config.ts",[425,491,492,504,516,520,531,536,545,551,557,563,569],{"__ignoreMap":5},[428,493,494,496,499,501],{"class":430,"line":431},[428,495,435],{"class":434},[428,497,498],{"class":438}," { defineConfig } ",[428,500,442],{"class":434},[428,502,503],{"class":445}," 'vite'\n",[428,505,506,508,511,513],{"class":430,"line":452},[428,507,435],{"class":434},[428,509,510],{"class":438}," { nitro } ",[428,512,442],{"class":434},[428,514,515],{"class":445}," 'nitro/vite'\n",[428,517,518],{"class":430,"line":459},[428,519,456],{"emptyLinePlaceholder":455},[428,521,522,524,526,529],{"class":430,"line":475},[428,523,462],{"class":434},[428,525,465],{"class":434},[428,527,528],{"class":468}," defineConfig",[428,530,472],{"class":438},[428,532,533],{"class":430,"line":482},[428,534,535],{"class":438},"  plugins: [\n",[428,537,539,542],{"class":430,"line":538},6,[428,540,541],{"class":468},"    nitro",[428,543,544],{"class":438},"()\n",[428,546,548],{"class":430,"line":547},7,[428,549,550],{"class":438},"  ],\n",[428,552,554],{"class":430,"line":553},8,[428,555,556],{"class":438},"  nitro: {\n",[428,558,560],{"class":430,"line":559},9,[428,561,562],{"class":478},"    // Nitro options\n",[428,564,566],{"class":430,"line":565},10,[428,567,568],{"class":438},"  }\n",[428,570,572],{"class":430,"line":571},11,[428,573,485],{"class":438},[575,576,577],"tip",{},[398,578,579,580,586,587,590],{},"\nNitro loads the configuration using ",[402,581,585],{"href":582,"rel":583},"https://github.com/unjs/c12",[584],"nofollow","c12",", giving more  possibilities such as using ",[425,588,589],{},".nitrorc"," file in current working directory or in the user's home directory.",[592,593,595],"h3",{"id":594},"environment-specific-config","Environment-specific config",[398,597,598,599,602,603,606,607,610],{},"Using ",[402,600,585],{"href":582,"rel":601},[584]," conventions, you can provide environment-specific overrides using ",[425,604,605],{},"$development"," and ",[425,608,609],{},"$production"," keys:",[418,612,614],{"className":420,"code":613,"filename":422,"language":423,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  logLevel: 3,\n  $development: {\n    // Options applied only in development mode\n    debug: true,\n  },\n  $production: {\n    // Options applied only in production builds\n    minify: true,\n  },\n})\n",[425,615,616,628,632,642,654,659,664,674,679,684,689,698,703],{"__ignoreMap":5},[428,617,618,620,622,624,626],{"class":430,"line":431},[428,619,435],{"class":434},[428,621,439],{"class":438},[428,623,442],{"class":434},[428,625,446],{"class":445},[428,627,449],{"class":438},[428,629,630],{"class":430,"line":452},[428,631,456],{"emptyLinePlaceholder":455},[428,633,634,636,638,640],{"class":430,"line":459},[428,635,462],{"class":434},[428,637,465],{"class":434},[428,639,469],{"class":468},[428,641,472],{"class":438},[428,643,644,647,651],{"class":430,"line":475},[428,645,646],{"class":438},"  logLevel: ",[428,648,650],{"class":649},"suiK_","3",[428,652,653],{"class":438},",\n",[428,655,656],{"class":430,"line":482},[428,657,658],{"class":438},"  $development: {\n",[428,660,661],{"class":430,"line":538},[428,662,663],{"class":478},"    // Options applied only in development mode\n",[428,665,666,669,672],{"class":430,"line":547},[428,667,668],{"class":438},"    debug: ",[428,670,671],{"class":649},"true",[428,673,653],{"class":438},[428,675,676],{"class":430,"line":553},[428,677,678],{"class":438},"  },\n",[428,680,681],{"class":430,"line":559},[428,682,683],{"class":438},"  $production: {\n",[428,685,686],{"class":430,"line":565},[428,687,688],{"class":478},"    // Options applied only in production builds\n",[428,690,691,694,696],{"class":430,"line":571},[428,692,693],{"class":438},"    minify: ",[428,695,671],{"class":649},[428,697,653],{"class":438},[428,699,701],{"class":430,"line":700},12,[428,702,678],{"class":438},[428,704,706],{"class":430,"line":705},13,[428,707,485],{"class":438},[398,709,710,711,714,715,606,718,714,721,724],{},"The environment name is ",[425,712,713],{},"\"development\""," during ",[425,716,717],{},"nitro dev",[425,719,720],{},"\"production\"",[425,722,723],{},"nitro build",".",[592,726,728],{"id":727},"extending-configs","Extending configs",[398,730,731,732,735],{},"You can extend from other configs or presets using the ",[425,733,734],{},"extends"," key:",[418,737,739],{"className":420,"code":738,"filename":422,"language":423,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  extends: \"./base.config\",\n})\n",[425,740,741,753,757,767,777],{"__ignoreMap":5},[428,742,743,745,747,749,751],{"class":430,"line":431},[428,744,435],{"class":434},[428,746,439],{"class":438},[428,748,442],{"class":434},[428,750,446],{"class":445},[428,752,449],{"class":438},[428,754,755],{"class":430,"line":452},[428,756,456],{"emptyLinePlaceholder":455},[428,758,759,761,763,765],{"class":430,"line":459},[428,760,462],{"class":434},[428,762,465],{"class":434},[428,764,469],{"class":468},[428,766,472],{"class":438},[428,768,769,772,775],{"class":430,"line":475},[428,770,771],{"class":438},"  extends: ",[428,773,774],{"class":445},"\"./base.config\"",[428,776,653],{"class":438},[428,778,779],{"class":430,"line":482},[428,780,485],{"class":438},[592,782,784,785],{"id":783},"config-from-packagejson","Config from ",[425,786,787],{},"package.json",[398,789,790,791,794,795,797],{},"You can also provide Nitro configuration under the ",[425,792,793],{},"nitro"," key in your ",[425,796,787],{}," file.",[407,799,801],{"id":800},"directory-options","Directory options",[398,803,804],{},"Nitro provides several options for controlling directory structure:",[806,807,808,824],"table",{},[809,810,811],"thead",{},[812,813,814,818,821],"tr",{},[815,816,817],"th",{},"Option",[815,819,820],{},"Default",[815,822,823],{},"Description",[825,826,827,843,866,881,896,911],"tbody",{},[812,828,829,835,840],{},[830,831,832],"td",{},[425,833,834],{},"rootDir",[830,836,837,839],{},[425,838,724],{}," (current directory)",[830,841,842],{},"The root directory of the project.",[812,844,845,850,855],{},[830,846,847],{},[425,848,849],{},"serverDir",[830,851,852],{},[425,853,854],{},"false",[830,856,857,858,861,862,865],{},"Server source directory (set to ",[425,859,860],{},"\"server\""," or ",[425,863,864],{},"\"./\""," to enable).",[812,867,868,873,878],{},[830,869,870],{},[425,871,872],{},"buildDir",[830,874,875],{},[425,876,877],{},"node_modules/.nitro",[830,879,880],{},"Directory for build artifacts.",[812,882,883,888,893],{},[830,884,885],{},[425,886,887],{},"output.dir",[830,889,890],{},[425,891,892],{},".output",[830,894,895],{},"Production output directory.",[812,897,898,903,908],{},[830,899,900],{},[425,901,902],{},"output.serverDir",[830,904,905],{},[425,906,907],{},".output/server",[830,909,910],{},"Server output directory.",[812,912,913,918,923],{},[830,914,915],{},[425,916,917],{},"output.publicDir",[830,919,920],{},[425,921,922],{},".output/public",[830,924,925],{},"Public assets output directory.",[418,927,929],{"className":420,"code":928,"filename":422,"language":423,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  serverDir: \"server\",\n  buildDir: \"node_modules/.nitro\",\n  output: {\n    dir: \".output\",\n  },\n})\n",[425,930,931,943,947,957,966,976,981,991,995],{"__ignoreMap":5},[428,932,933,935,937,939,941],{"class":430,"line":431},[428,934,435],{"class":434},[428,936,439],{"class":438},[428,938,442],{"class":434},[428,940,446],{"class":445},[428,942,449],{"class":438},[428,944,945],{"class":430,"line":452},[428,946,456],{"emptyLinePlaceholder":455},[428,948,949,951,953,955],{"class":430,"line":459},[428,950,462],{"class":434},[428,952,465],{"class":434},[428,954,469],{"class":468},[428,956,472],{"class":438},[428,958,959,962,964],{"class":430,"line":475},[428,960,961],{"class":438},"  serverDir: ",[428,963,860],{"class":445},[428,965,653],{"class":438},[428,967,968,971,974],{"class":430,"line":482},[428,969,970],{"class":438},"  buildDir: ",[428,972,973],{"class":445},"\"node_modules/.nitro\"",[428,975,653],{"class":438},[428,977,978],{"class":430,"line":538},[428,979,980],{"class":438},"  output: {\n",[428,982,983,986,989],{"class":430,"line":547},[428,984,985],{"class":438},"    dir: ",[428,987,988],{"class":445},"\".output\"",[428,990,653],{"class":438},[428,992,993],{"class":430,"line":553},[428,994,678],{"class":438},[428,996,997],{"class":430,"line":559},[428,998,485],{"class":438},[1000,1001,1002],"note",{},[398,1003,1004,1005,1008,1009,1011],{},"\nThe ",[425,1006,1007],{},"srcDir"," option is deprecated. Use ",[425,1010,849],{}," instead.",[407,1013,1015],{"id":1014},"environment-variables","Environment variables",[398,1017,1018],{},"Certain Nitro behaviors can be configured using environment variables:",[806,1020,1021,1030],{},[809,1022,1023],{},[812,1024,1025,1028],{},[815,1026,1027],{},"Variable",[815,1029,823],{},[825,1031,1032,1042,1052],{},[812,1033,1034,1039],{},[830,1035,1036],{},[425,1037,1038],{},"NITRO_PRESET",[830,1040,1041],{},"Override the deployment preset.",[812,1043,1044,1049],{},[830,1045,1046],{},[425,1047,1048],{},"NITRO_COMPATIBILITY_DATE",[830,1050,1051],{},"Set the compatibility date.",[812,1053,1054,1059],{},[830,1055,1056],{},[425,1057,1058],{},"NITRO_APP_BASE_URL",[830,1060,1061,1062,1064],{},"Override the base URL (default: ",[425,1063,387],{},").",[407,1066,1068],{"id":1067},"runtime-configuration","Runtime configuration",[398,1070,1071],{},"Nitro provides a runtime config API to expose configuration within your application, with the ability to update it at runtime by setting environment variables. This is useful when you want to expose different configuration values for different environments (e.g. development, staging, production). For example, you can use this to expose different API endpoints for different environments or to expose different feature flags.",[398,1073,1074],{},"First, you need to define the runtime config in your configuration file.",[418,1076,1078],{"className":420,"code":1077,"filename":422,"language":423,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  runtimeConfig: {\n    apiToken: \"dev_token\", // `dev_token` is the default value\n  }\n});\n",[425,1079,1080,1092,1096,1106,1111,1125,1129],{"__ignoreMap":5},[428,1081,1082,1084,1086,1088,1090],{"class":430,"line":431},[428,1083,435],{"class":434},[428,1085,439],{"class":438},[428,1087,442],{"class":434},[428,1089,446],{"class":445},[428,1091,449],{"class":438},[428,1093,1094],{"class":430,"line":452},[428,1095,456],{"emptyLinePlaceholder":455},[428,1097,1098,1100,1102,1104],{"class":430,"line":459},[428,1099,462],{"class":434},[428,1101,465],{"class":434},[428,1103,469],{"class":468},[428,1105,472],{"class":438},[428,1107,1108],{"class":430,"line":475},[428,1109,1110],{"class":438},"  runtimeConfig: {\n",[428,1112,1113,1116,1119,1122],{"class":430,"line":482},[428,1114,1115],{"class":438},"    apiToken: ",[428,1117,1118],{"class":445},"\"dev_token\"",[428,1120,1121],{"class":438},", ",[428,1123,1124],{"class":478},"// `dev_token` is the default value\n",[428,1126,1127],{"class":430,"line":538},[428,1128,568],{"class":438},[428,1130,1131],{"class":430,"line":547},[428,1132,1133],{"class":438},"});\n",[398,1135,1136,1137,724],{},"You can now access the runtime config using ",[425,1138,1139],{},"useRuntimeConfig()",[418,1141,1144],{"className":420,"code":1142,"filename":1143,"language":423,"meta":5,"style":5},"import { defineHandler } from \"nitro\";\nimport { useRuntimeConfig } from \"nitro/runtime-config\";\n\nexport default defineHandler((event) => {\n  return useRuntimeConfig().apiToken; // Returns `dev_token`\n});\n","api/example.get.ts",[425,1145,1146,1160,1174,1178,1203,1217],{"__ignoreMap":5},[428,1147,1148,1150,1153,1155,1158],{"class":430,"line":431},[428,1149,435],{"class":434},[428,1151,1152],{"class":438}," { defineHandler } ",[428,1154,442],{"class":434},[428,1156,1157],{"class":445}," \"nitro\"",[428,1159,449],{"class":438},[428,1161,1162,1164,1167,1169,1172],{"class":430,"line":452},[428,1163,435],{"class":434},[428,1165,1166],{"class":438}," { useRuntimeConfig } ",[428,1168,442],{"class":434},[428,1170,1171],{"class":445}," \"nitro/runtime-config\"",[428,1173,449],{"class":438},[428,1175,1176],{"class":430,"line":459},[428,1177,456],{"emptyLinePlaceholder":455},[428,1179,1180,1182,1184,1187,1190,1194,1197,1200],{"class":430,"line":475},[428,1181,462],{"class":434},[428,1183,465],{"class":434},[428,1185,1186],{"class":468}," defineHandler",[428,1188,1189],{"class":438},"((",[428,1191,1193],{"class":1192},"sQHwn","event",[428,1195,1196],{"class":438},") ",[428,1198,1199],{"class":434},"=>",[428,1201,1202],{"class":438}," {\n",[428,1204,1205,1208,1211,1214],{"class":430,"line":482},[428,1206,1207],{"class":434},"  return",[428,1209,1210],{"class":468}," useRuntimeConfig",[428,1212,1213],{"class":438},"().apiToken; ",[428,1215,1216],{"class":478},"// Returns `dev_token`\n",[428,1218,1219],{"class":430,"line":538},[428,1220,1133],{"class":438},[592,1222,1224],{"id":1223},"nested-objects","Nested objects",[398,1226,1227,1228,1231,1232,1235],{},"Runtime config supports nested objects. Keys at any depth are mapped to environment variables using the ",[425,1229,1230],{},"NITRO_"," prefix and ",[425,1233,1234],{},"UPPER_SNAKE_CASE"," conversion:",[415,1237,1238,1311],{},[418,1239,1241],{"className":420,"code":1240,"filename":422,"language":423,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  runtimeConfig: {\n    database: {\n      host: \"localhost\",\n      port: 5432,\n    },\n  },\n});\n",[425,1242,1243,1255,1259,1269,1273,1278,1288,1298,1303,1307],{"__ignoreMap":5},[428,1244,1245,1247,1249,1251,1253],{"class":430,"line":431},[428,1246,435],{"class":434},[428,1248,439],{"class":438},[428,1250,442],{"class":434},[428,1252,446],{"class":445},[428,1254,449],{"class":438},[428,1256,1257],{"class":430,"line":452},[428,1258,456],{"emptyLinePlaceholder":455},[428,1260,1261,1263,1265,1267],{"class":430,"line":459},[428,1262,462],{"class":434},[428,1264,465],{"class":434},[428,1266,469],{"class":468},[428,1268,472],{"class":438},[428,1270,1271],{"class":430,"line":475},[428,1272,1110],{"class":438},[428,1274,1275],{"class":430,"line":482},[428,1276,1277],{"class":438},"    database: {\n",[428,1279,1280,1283,1286],{"class":430,"line":538},[428,1281,1282],{"class":438},"      host: ",[428,1284,1285],{"class":445},"\"localhost\"",[428,1287,653],{"class":438},[428,1289,1290,1293,1296],{"class":430,"line":547},[428,1291,1292],{"class":438},"      port: ",[428,1294,1295],{"class":649},"5432",[428,1297,653],{"class":438},[428,1299,1300],{"class":430,"line":553},[428,1301,1302],{"class":438},"    },\n",[428,1304,1305],{"class":430,"line":559},[428,1306,678],{"class":438},[428,1308,1309],{"class":430,"line":565},[428,1310,1133],{"class":438},[418,1312,1317],{"className":1313,"code":1314,"filename":1315,"language":1316,"meta":5,"style":5},"language-bash shiki shiki-themes github-light github-dark github-dark","NITRO_DATABASE_HOST=\"db.example.com\"\nNITRO_DATABASE_PORT=\"5433\"\n",".env","bash",[425,1318,1319,1330],{"__ignoreMap":5},[428,1320,1321,1324,1327],{"class":430,"line":431},[428,1322,1323],{"class":438},"NITRO_DATABASE_HOST",[428,1325,1326],{"class":434},"=",[428,1328,1329],{"class":445},"\"db.example.com\"\n",[428,1331,1332,1335,1337],{"class":430,"line":452},[428,1333,1334],{"class":438},"NITRO_DATABASE_PORT",[428,1336,1326],{"class":434},[428,1338,1339],{"class":445},"\"5433\"\n",[1000,1341,1342],{},[398,1343,1344,1345,1348],{},"\nOnly keys defined in ",[425,1346,1347],{},"runtimeConfig"," in your config file will be considered. You cannot introduce new keys using environment variables alone.",[592,1350,1352],{"id":1351},"serialization","Serialization",[398,1354,1355],{},"Runtime config values must be serializable (strings, numbers, booleans, plain objects, and arrays). Non-serializable values (class instances, functions, etc.) will trigger a warning at build time.",[398,1357,1358,1359,861,1362,1365,1366,1369],{},"Values that are ",[425,1360,1361],{},"undefined",[425,1363,1364],{},"null"," in the config are replaced with empty strings (",[425,1367,1368],{},"\"\"",") as a fallback.",[592,1371,1373],{"id":1372},"local-development","Local development",[398,1375,1376,1377,861,1379,1382],{},"You can update the runtime config using environment variables. You can use a ",[425,1378,1315],{},[425,1380,1381],{},".env.local"," file in development and use platform variables in production (see below).",[398,1384,1385,1386,1388],{},"Create an ",[425,1387,1315],{}," file in your project root:",[418,1390,1392],{"className":1313,"code":1391,"filename":1315,"language":1316,"meta":5,"style":5},"NITRO_API_TOKEN=\"123\"\n",[425,1393,1394],{"__ignoreMap":5},[428,1395,1396,1399,1401],{"class":430,"line":431},[428,1397,1398],{"class":438},"NITRO_API_TOKEN",[428,1400,1326],{"class":434},[428,1402,1403],{"class":445},"\"123\"\n",[398,1405,1406,1407,1410,1411,1414,1415,724],{},"Re-start the development server, fetch the ",[425,1408,1409],{},"/api/example"," endpoint and you should see ",[425,1412,1413],{},"123"," as the response instead of ",[425,1416,1417],{},"dev_token",[1000,1419,1420],{},[398,1421,1004,1422,606,1424,1426,1427,1429],{},[425,1423,1315],{},[425,1425,1381],{}," files are only loaded during development (",[425,1428,717],{},"). In production, use your platform's native environment variable mechanism.",[398,1431,1432,1433,861,1436,1439],{},"Do not forget that you can still universally access environment variables using ",[425,1434,1435],{},"import.meta.env",[425,1437,1438],{},"process.env"," but avoid using them in ambient global contexts to prevent unexpected behavior.",[592,1441,1443],{"id":1442},"production","Production",[398,1445,1446],{},"You can define variables in your production environment to update the runtime config.",[1448,1449,1450],"warning",{},[398,1451,1452,1453,1455,1456,797],{},"All variables must be prefixed with ",[425,1454,1230],{}," to be applied to the runtime config. They will override the runtime config variables defined within your ",[425,1457,422],{},[418,1459,1460],{"className":1313,"code":1391,"filename":1315,"language":1316,"meta":5,"style":5},[425,1461,1462],{"__ignoreMap":5},[428,1463,1464,1466,1468],{"class":430,"line":431},[428,1465,1398],{"class":438},[428,1467,1326],{"class":434},[428,1469,1403],{"class":445},[398,1471,1472],{},"In runtime config, define key using camelCase. In environment variables, define key using snake_case and uppercase.",[418,1474,1476],{"className":420,"code":1475,"language":423,"meta":5,"style":5},"{\n  helloWorld: \"foo\"\n}\n",[425,1477,1478,1483,1494],{"__ignoreMap":5},[428,1479,1480],{"class":430,"line":431},[428,1481,1482],{"class":438},"{\n",[428,1484,1485,1488,1491],{"class":430,"line":452},[428,1486,1487],{"class":468},"  helloWorld",[428,1489,1490],{"class":438},": ",[428,1492,1493],{"class":445},"\"foo\"\n",[428,1495,1496],{"class":430,"line":459},[428,1497,1498],{"class":438},"}\n",[418,1500,1502],{"className":1313,"code":1501,"language":1316,"meta":5,"style":5},"NITRO_HELLO_WORLD=\"foo\"\n",[425,1503,1504],{"__ignoreMap":5},[428,1505,1506,1509,1511],{"class":430,"line":431},[428,1507,1508],{"class":438},"NITRO_HELLO_WORLD",[428,1510,1326],{"class":434},[428,1512,1493],{"class":445},[592,1514,1516],{"id":1515},"custom-env-prefix","Custom env prefix",[398,1518,1519,1520,1523,1524,1526],{},"You can configure a secondary environment variable prefix using the ",[425,1521,1522],{},"nitro.envPrefix"," runtime config key. This prefix is checked in addition to the default ",[425,1525,1230],{}," prefix:",[418,1528,1530],{"className":420,"code":1529,"filename":422,"language":423,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  runtimeConfig: {\n    nitro: {\n      envPrefix: \"APP_\",\n    },\n    apiToken: \"\",\n  },\n});\n",[425,1531,1532,1544,1548,1558,1562,1567,1577,1581,1589,1593],{"__ignoreMap":5},[428,1533,1534,1536,1538,1540,1542],{"class":430,"line":431},[428,1535,435],{"class":434},[428,1537,439],{"class":438},[428,1539,442],{"class":434},[428,1541,446],{"class":445},[428,1543,449],{"class":438},[428,1545,1546],{"class":430,"line":452},[428,1547,456],{"emptyLinePlaceholder":455},[428,1549,1550,1552,1554,1556],{"class":430,"line":459},[428,1551,462],{"class":434},[428,1553,465],{"class":434},[428,1555,469],{"class":468},[428,1557,472],{"class":438},[428,1559,1560],{"class":430,"line":475},[428,1561,1110],{"class":438},[428,1563,1564],{"class":430,"line":482},[428,1565,1566],{"class":438},"    nitro: {\n",[428,1568,1569,1572,1575],{"class":430,"line":538},[428,1570,1571],{"class":438},"      envPrefix: ",[428,1573,1574],{"class":445},"\"APP_\"",[428,1576,653],{"class":438},[428,1578,1579],{"class":430,"line":547},[428,1580,1302],{"class":438},[428,1582,1583,1585,1587],{"class":430,"line":553},[428,1584,1115],{"class":438},[428,1586,1368],{"class":445},[428,1588,653],{"class":438},[428,1590,1591],{"class":430,"line":559},[428,1592,678],{"class":438},[428,1594,1595],{"class":430,"line":565},[428,1596,1133],{"class":438},[398,1598,1599,1600,606,1602,1605],{},"With this configuration, both ",[425,1601,1398],{},[425,1603,1604],{},"APP_API_TOKEN"," will be checked as overrides.",[592,1607,1609],{"id":1608},"env-expansion","Env expansion",[398,1611,1612,1613,1616],{},"When enabled, environment variable references using ",[425,1614,1615],{},"{{VAR_NAME}}"," syntax in runtime config string values are expanded at runtime:",[418,1618,1620],{"className":420,"code":1619,"filename":422,"language":423,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  experimental: {\n    envExpansion: true,\n  },\n  runtimeConfig: {\n    url: \"https://{{APP_DOMAIN}}/api\",\n  },\n});\n",[425,1621,1622,1634,1638,1648,1653,1662,1666,1670,1680,1684],{"__ignoreMap":5},[428,1623,1624,1626,1628,1630,1632],{"class":430,"line":431},[428,1625,435],{"class":434},[428,1627,439],{"class":438},[428,1629,442],{"class":434},[428,1631,446],{"class":445},[428,1633,449],{"class":438},[428,1635,1636],{"class":430,"line":452},[428,1637,456],{"emptyLinePlaceholder":455},[428,1639,1640,1642,1644,1646],{"class":430,"line":459},[428,1641,462],{"class":434},[428,1643,465],{"class":434},[428,1645,469],{"class":468},[428,1647,472],{"class":438},[428,1649,1650],{"class":430,"line":475},[428,1651,1652],{"class":438},"  experimental: {\n",[428,1654,1655,1658,1660],{"class":430,"line":482},[428,1656,1657],{"class":438},"    envExpansion: ",[428,1659,671],{"class":649},[428,1661,653],{"class":438},[428,1663,1664],{"class":430,"line":538},[428,1665,678],{"class":438},[428,1667,1668],{"class":430,"line":547},[428,1669,1110],{"class":438},[428,1671,1672,1675,1678],{"class":430,"line":553},[428,1673,1674],{"class":438},"    url: ",[428,1676,1677],{"class":445},"\"https://{{APP_DOMAIN}}/api\"",[428,1679,653],{"class":438},[428,1681,1682],{"class":430,"line":559},[428,1683,678],{"class":438},[428,1685,1686],{"class":430,"line":565},[428,1687,1133],{"class":438},[418,1689,1691],{"className":1313,"code":1690,"language":1316,"meta":5,"style":5},"APP_DOMAIN=\"example.com\"\n",[425,1692,1693],{"__ignoreMap":5},[428,1694,1695,1698,1700],{"class":430,"line":431},[428,1696,1697],{"class":438},"APP_DOMAIN",[428,1699,1326],{"class":434},[428,1701,1702],{"class":445},"\"example.com\"\n",[398,1704,1705,1706,1709,1710,724],{},"At runtime, ",[425,1707,1708],{},"useRuntimeConfig().url"," will resolve to ",[425,1711,1712],{},"\"https://example.com/api\"",[1714,1715,1716],"style",{},"html pre.shiki code .so5gQ, html code.shiki .so5gQ{--shiki-light:#D73A49;--shiki-default:#F97583;--shiki-dark:#F97583}html pre.shiki code .slsVL, html code.shiki .slsVL{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}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 .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}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 .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":452,"depth":452,"links":1718},[1719,1725,1726,1727],{"id":409,"depth":452,"text":410,"children":1720},[1721,1722,1723],{"id":594,"depth":459,"text":595},{"id":727,"depth":459,"text":728},{"id":783,"depth":459,"text":1724},"Config from package.json",{"id":800,"depth":452,"text":801},{"id":1014,"depth":452,"text":1015},{"id":1067,"depth":452,"text":1068,"children":1728},[1729,1730,1731,1732,1733,1734],{"id":1223,"depth":459,"text":1224},{"id":1351,"depth":459,"text":1352},{"id":1372,"depth":459,"text":1373},{"id":1442,"depth":459,"text":1443},{"id":1515,"depth":459,"text":1516},{"id":1608,"depth":459,"text":1609},"Customize and extend Nitro defaults.","md",{"icon":36},{"icon":36},{"title":33,"description":1735},"CVcVI0p3tWUN-ajYtcdlGoq69sFeUrvLMgFqBgZe3gI",[1742,1743],{"title":28,"path":29,"stem":30,"description":5,"icon":31,"children":-1},{"title":38,"path":39,"stem":40,"description":1744,"icon":41,"children":-1},"Nitro provides a built-in and lightweight SQL database layer.",1775151960002]