[{"data":1,"prerenderedAt":743},["ShallowReactive",2],{"navigation":3,"-docs-configuration":224,"-docs-configuration-surround":739},[4,83,208,214,221],{"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],{"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},"Zerops","/deploy/providers/zerops","2.deploy/20.providers/zerops",{"title":209,"path":210,"stem":211,"children":212,"icon":36},"Config","/config","3.config/0.index",[213],{"title":209,"path":210,"stem":211,"icon":36},{"title":215,"path":216,"stem":217,"children":218,"icon":220},"Examples","/examples","4.examples/0.index",[219],{"title":215,"path":216,"stem":217,"icon":220},"i-lucide-folder-code",{"title":5,"path":222,"stem":223},"/","index",{"id":225,"title":33,"body":226,"description":733,"extension":734,"meta":735,"navigation":736,"path":34,"seo":737,"stem":35,"__hash__":738},"content/1.docs/50.configuration.md",{"type":227,"value":228,"toc":727,"icon":36},"minimark",[229,236,247,250,410,427,432,435,438,497,504,585,590,601,607,625,639,649,653,656,668,680,683,709,723],[230,231,232],"warning",{},[233,234,235],"p",{},"Nitro v3 Alpha docs are a work in progress — expect updates, rough edges, and occasional inaccuracies.",[237,238,239],"read-more",{"to":210},[233,240,241,242,246],{},"See ",[243,244,245],"a",{"href":210},"config reference"," for available options.",[233,248,249],{},"You can customize your Nitro builder with a configuration file.",[251,252,253,322],"CodeGroup",{},[254,255,260],"pre",{"className":256,"code":257,"filename":258,"language":259,"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",[261,262,263,286,293,309,316],"code",{"__ignoreMap":5},[264,265,268,272,276,279,283],"span",{"class":266,"line":267},"line",1,[264,269,271],{"class":270},"so5gQ","import",[264,273,275],{"class":274},"slsVL"," { defineNitroConfig } ",[264,277,278],{"class":270},"from",[264,280,282],{"class":281},"sfrk1"," \"nitro/config\"",[264,284,285],{"class":274},";\n",[264,287,289],{"class":266,"line":288},2,[264,290,292],{"emptyLinePlaceholder":291},true,"\n",[264,294,296,299,302,306],{"class":266,"line":295},3,[264,297,298],{"class":270},"export",[264,300,301],{"class":270}," default",[264,303,305],{"class":304},"shcOC"," defineNitroConfig",[264,307,308],{"class":274},"({\n",[264,310,312],{"class":266,"line":311},4,[264,313,315],{"class":314},"sCsY4","  // Nitro options\n",[264,317,319],{"class":266,"line":318},5,[264,320,321],{"class":274},"})\n",[254,323,326],{"className":256,"code":324,"filename":325,"language":259,"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",[261,327,328,340,352,356,367,372,381,387,393,399,405],{"__ignoreMap":5},[264,329,330,332,335,337],{"class":266,"line":267},[264,331,271],{"class":270},[264,333,334],{"class":274}," { defineConfig } ",[264,336,278],{"class":270},[264,338,339],{"class":281}," 'vite'\n",[264,341,342,344,347,349],{"class":266,"line":288},[264,343,271],{"class":270},[264,345,346],{"class":274}," { nitro } ",[264,348,278],{"class":270},[264,350,351],{"class":281}," 'nitro/vite'\n",[264,353,354],{"class":266,"line":295},[264,355,292],{"emptyLinePlaceholder":291},[264,357,358,360,362,365],{"class":266,"line":311},[264,359,298],{"class":270},[264,361,301],{"class":270},[264,363,364],{"class":304}," defineConfig",[264,366,308],{"class":274},[264,368,369],{"class":266,"line":318},[264,370,371],{"class":274},"  plugins: [\n",[264,373,375,378],{"class":266,"line":374},6,[264,376,377],{"class":304},"    nitro",[264,379,380],{"class":274},"()\n",[264,382,384],{"class":266,"line":383},7,[264,385,386],{"class":274},"  ],\n",[264,388,390],{"class":266,"line":389},8,[264,391,392],{"class":274},"  nitro: {\n",[264,394,396],{"class":266,"line":395},9,[264,397,398],{"class":314},"    // Nitro options\n",[264,400,402],{"class":266,"line":401},10,[264,403,404],{"class":274},"  }\n",[264,406,408],{"class":266,"line":407},11,[264,409,321],{"class":274},[411,412,413],"tip",{},[233,414,415,416,422,423,426],{},"\nNitro loads the configuration using ",[243,417,421],{"href":418,"rel":419},"https://github.com/unjs/c12",[420],"nofollow","c12",", giving more  possibilities such as using ",[261,424,425],{},".nitrorc"," file in current working directory or in the user's home directory.",[428,429,431],"h2",{"id":430},"runtime-configuration","Runtime configuration",[233,433,434],{},"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.",[233,436,437],{},"First, you need to define the runtime config in your configuration file.",[254,439,441],{"className":256,"code":440,"filename":258,"language":259,"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",[261,442,443,455,459,469,474,488,492],{"__ignoreMap":5},[264,444,445,447,449,451,453],{"class":266,"line":267},[264,446,271],{"class":270},[264,448,275],{"class":274},[264,450,278],{"class":270},[264,452,282],{"class":281},[264,454,285],{"class":274},[264,456,457],{"class":266,"line":288},[264,458,292],{"emptyLinePlaceholder":291},[264,460,461,463,465,467],{"class":266,"line":295},[264,462,298],{"class":270},[264,464,301],{"class":270},[264,466,305],{"class":304},[264,468,308],{"class":274},[264,470,471],{"class":266,"line":311},[264,472,473],{"class":274},"  runtimeConfig: {\n",[264,475,476,479,482,485],{"class":266,"line":318},[264,477,478],{"class":274},"    apiToken: ",[264,480,481],{"class":281},"\"dev_token\"",[264,483,484],{"class":274},", ",[264,486,487],{"class":314},"// `dev_token` is the default value\n",[264,489,490],{"class":266,"line":374},[264,491,404],{"class":274},[264,493,494],{"class":266,"line":383},[264,495,496],{"class":274},"});\n",[233,498,499,500,503],{},"You can now access the runtime config using ",[261,501,502],{},"useRuntimeConfig()",".",[254,505,508],{"className":256,"code":506,"filename":507,"language":259,"meta":5,"style":5},"import { defineHandler } from \"nitro/h3\";\nimport { useRuntimeConfig } from \"nitro/runtime-config\";\n\nexport default defineHandler((event) => {\n  return useRuntimeConfig().apiToken; // Returns `dev_token`\n});\n","api/example.get.ts",[261,509,510,524,538,542,567,581],{"__ignoreMap":5},[264,511,512,514,517,519,522],{"class":266,"line":267},[264,513,271],{"class":270},[264,515,516],{"class":274}," { defineHandler } ",[264,518,278],{"class":270},[264,520,521],{"class":281}," \"nitro/h3\"",[264,523,285],{"class":274},[264,525,526,528,531,533,536],{"class":266,"line":288},[264,527,271],{"class":270},[264,529,530],{"class":274}," { useRuntimeConfig } ",[264,532,278],{"class":270},[264,534,535],{"class":281}," \"nitro/runtime-config\"",[264,537,285],{"class":274},[264,539,540],{"class":266,"line":295},[264,541,292],{"emptyLinePlaceholder":291},[264,543,544,546,548,551,554,558,561,564],{"class":266,"line":311},[264,545,298],{"class":270},[264,547,301],{"class":270},[264,549,550],{"class":304}," defineHandler",[264,552,553],{"class":274},"((",[264,555,557],{"class":556},"sQHwn","event",[264,559,560],{"class":274},") ",[264,562,563],{"class":270},"=>",[264,565,566],{"class":274}," {\n",[264,568,569,572,575,578],{"class":266,"line":318},[264,570,571],{"class":270},"  return",[264,573,574],{"class":304}," useRuntimeConfig",[264,576,577],{"class":274},"().apiToken; ",[264,579,580],{"class":314},"// Returns `dev_token`\n",[264,582,583],{"class":266,"line":374},[264,584,496],{"class":274},[586,587,589],"h3",{"id":588},"local-development","Local development",[233,591,592,593,596,597,600],{},"Finally, you can update the runtime config using environment variables. You can use a ",[261,594,595],{},".env"," or ",[261,598,599],{},".env.local"," file in development and use platform variables in production (see below).",[233,602,603,604,606],{},"Create an ",[261,605,595],{}," file in your project root:",[254,608,612],{"className":609,"code":610,"filename":595,"language":611,"meta":5,"style":5},"language-bash shiki shiki-themes github-light github-dark github-dark","NITRO_API_TOKEN=\"123\"\n","bash",[261,613,614],{"__ignoreMap":5},[264,615,616,619,622],{"class":266,"line":267},[264,617,618],{"class":274},"NITRO_API_TOKEN",[264,620,621],{"class":270},"=",[264,623,624],{"class":281},"\"123\"\n",[233,626,627,628,631,632,635,636,503],{},"Re-start the development server, fetch the ",[261,629,630],{},"/api/example"," endpoint and you should see ",[261,633,634],{},"123"," as the response instead of ",[261,637,638],{},"dev_token",[233,640,641,642,596,645,648],{},"Do not forget that you can still universally access environment variables using ",[261,643,644],{},"import.meta.env",[261,646,647],{},"process.env"," but avoid using them in ambient global contexts to prevent unexpected behavior.",[586,650,652],{"id":651},"production","Production",[233,654,655],{},"You can define variables in your production environment to update the runtime config.",[230,657,658],{},[233,659,660,661,664,665,667],{},"All variables must be prefixed with ",[261,662,663],{},"NITRO_"," to be applied to the runtime config. They will override the runtime config variables defined within your ",[261,666,258],{}," file.",[254,669,670],{"className":609,"code":610,"filename":595,"language":611,"meta":5,"style":5},[261,671,672],{"__ignoreMap":5},[264,673,674,676,678],{"class":266,"line":267},[264,675,618],{"class":274},[264,677,621],{"class":270},[264,679,624],{"class":281},[233,681,682],{},"In runtime config, define key using camelCase. In environment variables, define key using snake_case and uppercase.",[254,684,686],{"className":256,"code":685,"language":259,"meta":5,"style":5},"{\n  helloWorld: \"foo\"\n}\n",[261,687,688,693,704],{"__ignoreMap":5},[264,689,690],{"class":266,"line":267},[264,691,692],{"class":274},"{\n",[264,694,695,698,701],{"class":266,"line":288},[264,696,697],{"class":304},"  helloWorld",[264,699,700],{"class":274},": ",[264,702,703],{"class":281},"\"foo\"\n",[264,705,706],{"class":266,"line":295},[264,707,708],{"class":274},"}\n",[254,710,712],{"className":609,"code":711,"language":611,"meta":5,"style":5},"NITRO_HELLO_WORLD=\"foo\"\n",[261,713,714],{"__ignoreMap":5},[264,715,716,719,721],{"class":266,"line":267},[264,717,718],{"class":274},"NITRO_HELLO_WORLD",[264,720,621],{"class":270},[264,722,703],{"class":281},[724,725,726],"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 .sQHwn, html code.shiki .sQHwn{--shiki-light:#E36209;--shiki-default:#FFAB70;--shiki-dark:#FFAB70}",{"title":5,"searchDepth":288,"depth":288,"links":728},[729],{"id":430,"depth":288,"text":431,"children":730},[731,732],{"id":588,"depth":295,"text":589},{"id":651,"depth":295,"text":652},"Customize and extend Nitro defaults.","md",{"icon":36},{"icon":36},{"title":33,"description":733},"nVregJiT1i0J5gYw3ATK9BxWCoIjPsHUHwG0MRgOFT4",[740,741],{"title":28,"path":29,"stem":30,"description":5,"icon":31,"children":-1},{"title":38,"path":39,"stem":40,"description":742,"icon":41,"children":-1},"Nitro provides a built-in and lightweight SQL database layer.",1773050448408]