[{"data":1,"prerenderedAt":1371},["ShallowReactive",2],{"navigation":3,"-docs-migration":377,"-docs-migration-surround":1366},[4,83,212,218,374],{"title":5,"path":6,"stem":7,"children":8,"icon":82},"","/docs","1.docs/1.index",[9,12,17,22,27,32,37,42,47,52,57,62,67,72,77],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-compass",{"title":13,"path":14,"stem":15,"icon":16},"Quick Start","/docs/quick-start","1.docs/2.quick-start","i-lucide-zap",{"title":18,"path":19,"stem":20,"icon":21},"Renderer","/docs/renderer","1.docs/4.renderer","ri:layout-masonry-line",{"title":23,"path":24,"stem":25,"icon":26},"Routing","/docs/routing","1.docs/5.routing","ri:direction-line",{"title":28,"path":29,"stem":30,"icon":31},"Assets","/docs/assets","1.docs/50.assets","ri:image-2-line",{"title":33,"path":34,"stem":35,"icon":36},"Configuration","/docs/configuration","1.docs/50.configuration","ri:settings-3-line",{"title":38,"path":39,"stem":40,"icon":41},"Database","/docs/database","1.docs/50.database","ri:database-2-line",{"title":43,"path":44,"stem":45,"icon":46},"Lifecycle","/docs/lifecycle","1.docs/50.lifecycle","i-lucide-layers",{"title":48,"path":49,"stem":50,"icon":51},"Plugins","/docs/plugins","1.docs/50.plugins","ri:plug-line",{"title":53,"path":54,"stem":55,"icon":56},"Tasks","/docs/tasks","1.docs/50.tasks","codicon:run-all",{"title":58,"path":59,"stem":60,"icon":61},"Server Entry","/docs/server-entry","1.docs/6.server-entry","ri:server-line",{"title":63,"path":64,"stem":65,"icon":66},"Cache","/docs/cache","1.docs/7.cache","ri:speed-line",{"title":68,"path":69,"stem":70,"icon":71},"KV Storage","/docs/storage","1.docs/8.storage","carbon:datastore",{"title":73,"path":74,"stem":75,"icon":76},"Migration Guide","/docs/migration","1.docs/99.migration","ri:arrow-right-up-line",{"title":78,"path":79,"stem":80,"icon":81},"Nightly Channel","/docs/nightly","1.docs/99.nightly","ri:moon-fill","i-lucide-book-open",{"title":84,"path":85,"stem":86,"children":87,"icon":89},"Deploy","/deploy","2.deploy/0.index",[88,90,111],{"title":84,"path":85,"stem":86,"icon":89},"ri:upload-cloud-2-line",{"title":91,"path":92,"stem":93,"children":94,"page":110},"Runtimes","/deploy/runtimes","2.deploy/10.runtimes",[95,100,105],{"title":96,"path":97,"stem":98,"icon":99},"Node.js","/deploy/runtimes/node","2.deploy/10.runtimes/1.node","akar-icons:node-fill",{"title":101,"path":102,"stem":103,"icon":104},"Bun","/deploy/runtimes/bun","2.deploy/10.runtimes/bun","simple-icons:bun",{"title":106,"path":107,"stem":108,"icon":109},"Deno","/deploy/runtimes/deno","2.deploy/10.runtimes/deno","simple-icons:deno",false,{"title":112,"path":113,"stem":114,"children":115,"page":110},"Providers","/deploy/providers","2.deploy/20.providers",[116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208],{"title":117,"path":118,"stem":119},"Alwaysdata","/deploy/providers/alwaysdata","2.deploy/20.providers/alwaysdata",{"title":121,"path":122,"stem":123},"AWS Lambda","/deploy/providers/aws","2.deploy/20.providers/aws",{"title":125,"path":126,"stem":127},"AWS Amplify","/deploy/providers/aws-amplify","2.deploy/20.providers/aws-amplify",{"title":129,"path":130,"stem":131},"Azure","/deploy/providers/azure","2.deploy/20.providers/azure",{"title":133,"path":134,"stem":135},"Cleavr","/deploy/providers/cleavr","2.deploy/20.providers/cleavr",{"title":137,"path":138,"stem":139},"Cloudflare","/deploy/providers/cloudflare","2.deploy/20.providers/cloudflare",{"title":141,"path":142,"stem":143},"Deno Deploy","/deploy/providers/deno-deploy","2.deploy/20.providers/deno-deploy",{"title":145,"path":146,"stem":147},"DigitalOcean","/deploy/providers/digitalocean","2.deploy/20.providers/digitalocean",{"title":149,"path":150,"stem":151},"Firebase","/deploy/providers/firebase","2.deploy/20.providers/firebase",{"title":153,"path":154,"stem":155},"Flightcontrol","/deploy/providers/flightcontrol","2.deploy/20.providers/flightcontrol",{"title":157,"path":158,"stem":159},"Genezio","/deploy/providers/genezio","2.deploy/20.providers/genezio",{"title":161,"path":162,"stem":163},"GitHub Pages","/deploy/providers/github-pages","2.deploy/20.providers/github-pages",{"title":165,"path":166,"stem":167},"GitLab Pages","/deploy/providers/gitlab-pages","2.deploy/20.providers/gitlab-pages",{"title":169,"path":170,"stem":171},"Heroku","/deploy/providers/heroku","2.deploy/20.providers/heroku",{"title":173,"path":174,"stem":175},"IIS","/deploy/providers/iis","2.deploy/20.providers/iis",{"title":177,"path":178,"stem":179},"Koyeb","/deploy/providers/koyeb","2.deploy/20.providers/koyeb",{"title":181,"path":182,"stem":183},"Netlify","/deploy/providers/netlify","2.deploy/20.providers/netlify",{"title":185,"path":186,"stem":187},"Platform.sh","/deploy/providers/platform-sh","2.deploy/20.providers/platform-sh",{"title":189,"path":190,"stem":191},"Render.com","/deploy/providers/render","2.deploy/20.providers/render",{"title":193,"path":194,"stem":195},"StormKit","/deploy/providers/stormkit","2.deploy/20.providers/stormkit",{"title":197,"path":198,"stem":199},"Vercel","/deploy/providers/vercel","2.deploy/20.providers/vercel",{"title":201,"path":202,"stem":203},"Zeabur","/deploy/providers/zeabur","2.deploy/20.providers/zeabur",{"title":205,"path":206,"stem":207},"Zephyr Cloud","/deploy/providers/zephyr","2.deploy/20.providers/zephyr",{"title":209,"path":210,"stem":211},"Zerops","/deploy/providers/zerops","2.deploy/20.providers/zerops",{"title":213,"path":214,"stem":215,"children":216,"icon":36},"Config","/config","3.config/0.index",[217],{"title":213,"path":214,"stem":215,"icon":36},{"title":219,"path":220,"stem":221,"children":222,"icon":224},"Examples","/examples","4.examples/0.index",[223,225,230,235,240,245,249,254,259,264,269,274,279,283,288,292,296,301,306,311,316,321,326,331,336,341,345,350,355,359,364,369],{"title":219,"path":220,"stem":221,"icon":224},"i-lucide-folder-code",{"title":226,"path":227,"stem":228,"icon":229},"API Routes","/examples/api-routes","4.examples/api-routes","i-lucide-route",{"title":231,"path":232,"stem":233,"icon":234},"Auto Imports","/examples/auto-imports","4.examples/auto-imports","i-lucide-import",{"title":236,"path":237,"stem":238,"icon":239},"Cached Handler","/examples/cached-handler","4.examples/cached-handler","i-lucide-clock",{"title":241,"path":242,"stem":243,"icon":244},"Custom Error Handler","/examples/custom-error-handler","4.examples/custom-error-handler","i-lucide-alert-circle",{"title":38,"path":246,"stem":247,"icon":248},"/examples/database","4.examples/database","i-lucide-database",{"title":250,"path":251,"stem":252,"icon":253},"Elysia","/examples/elysia","4.examples/elysia","i-skill-icons-elysia-dark",{"title":255,"path":256,"stem":257,"icon":258},"Express","/examples/express","4.examples/express","i-simple-icons-express",{"title":260,"path":261,"stem":262,"icon":263},"Fastify","/examples/fastify","4.examples/fastify","i-simple-icons-fastify",{"title":265,"path":266,"stem":267,"icon":268},"Hello World","/examples/hello-world","4.examples/hello-world","i-lucide-sparkles",{"title":270,"path":271,"stem":272,"icon":273},"Hono","/examples/hono","4.examples/hono","i-logos-hono",{"title":275,"path":276,"stem":277,"icon":278},"Import Alias","/examples/import-alias","4.examples/import-alias","i-lucide-at-sign",{"title":280,"path":281,"stem":282,"icon":46},"Middleware","/examples/middleware","4.examples/middleware",{"title":284,"path":285,"stem":286,"icon":287},"Mono JSX","/examples/mono-jsx","4.examples/mono-jsx","i-lucide-brackets",{"title":289,"path":290,"stem":291,"icon":287},"Nano JSX","/examples/nano-jsx","4.examples/nano-jsx",{"title":48,"path":293,"stem":294,"icon":295},"/examples/plugins","4.examples/plugins","i-lucide-plug",{"title":297,"path":298,"stem":299,"icon":300},"Custom Renderer","/examples/renderer","4.examples/renderer","i-lucide-code",{"title":302,"path":303,"stem":304,"icon":305},"Runtime Config","/examples/runtime-config","4.examples/runtime-config","i-lucide-settings",{"title":307,"path":308,"stem":309,"icon":310},"Server Fetch","/examples/server-fetch","4.examples/server-fetch","i-lucide-arrow-right-left",{"title":312,"path":313,"stem":314,"icon":315},"Shiki","/examples/shiki","4.examples/shiki","i-lucide-highlighter",{"title":317,"path":318,"stem":319,"icon":320},"Virtual Routes","/examples/virtual-routes","4.examples/virtual-routes","i-lucide-box",{"title":322,"path":323,"stem":324,"icon":325},"Vite Nitro Plugin","/examples/vite-nitro-plugin","4.examples/vite-nitro-plugin","i-logos-vitejs",{"title":327,"path":328,"stem":329,"icon":330},"Vite RSC","/examples/vite-rsc","4.examples/vite-rsc","i-logos-react",{"title":332,"path":333,"stem":334,"icon":335},"Vite SSR HTML","/examples/vite-ssr-html","4.examples/vite-ssr-html","i-logos-html-5",{"title":337,"path":338,"stem":339,"icon":340},"SSR with Preact","/examples/vite-ssr-preact","4.examples/vite-ssr-preact","i-logos-preact",{"title":342,"path":343,"stem":344,"icon":330},"SSR with React","/examples/vite-ssr-react","4.examples/vite-ssr-react",{"title":346,"path":347,"stem":348,"icon":349},"SSR with SolidJS","/examples/vite-ssr-solid","4.examples/vite-ssr-solid","i-logos-solidjs-icon",{"title":351,"path":352,"stem":353,"icon":354},"SSR with TanStack Router","/examples/vite-ssr-tsr-react","4.examples/vite-ssr-tsr-react","i-simple-icons-tanstack",{"title":356,"path":357,"stem":358,"icon":354},"SSR with TanStack Start","/examples/vite-ssr-tss-react","4.examples/vite-ssr-tss-react",{"title":360,"path":361,"stem":362,"icon":363},"SSR with Vue Router","/examples/vite-ssr-vue-router","4.examples/vite-ssr-vue-router","i-logos-vue",{"title":365,"path":366,"stem":367,"icon":368},"Vite + tRPC","/examples/vite-trpc","4.examples/vite-trpc","i-simple-icons-trpc",{"title":370,"path":371,"stem":372,"icon":373},"WebSocket","/examples/websocket","4.examples/websocket","i-lucide-radio",{"title":5,"path":375,"stem":376},"/","index",{"id":378,"title":73,"body":379,"description":5,"extension":1361,"meta":1362,"navigation":1363,"path":74,"seo":1364,"stem":75,"__hash__":1365},"content/1.docs/99.migration.md",{"type":380,"value":381,"toc":1340,"icon":76},"minimark",[382,389,392,404,419,436,520,525,540,544,551,566,570,579,588,592,609,613,619,624,639,643,653,656,660,667,671,674,677,856,860,866,869,873,898,902,905,937,943,947,966,970,981,986,1019,1038,1042,1053,1100,1103,1130,1134,1140,1175,1178,1201,1236,1240,1255,1273,1277,1302,1306,1321,1325,1336],[383,384,385],"note",{},[386,387,388],"p",{},"\nThis is a living document for migrating from Nitro 2 to 3. Please check it regularly while using the beta version.",[386,390,391],{},"Nitro v3 introduces intentional backward-incompatible changes. This guide helps you migrate from Nitro v2.",[393,394,396,400,401],"h2",{"id":395},"nitropack-is-renamed-to-nitro",[397,398,399],"code",{},"nitropack"," is renamed to ",[397,402,403],{},"nitro",[386,405,406,407,413,414,418],{},"The NPM package ",[408,409,399],"a",{"href":410,"rel":411},"https://www.npmjs.com/package/nitropack",[412],"nofollow"," (v2) has been renamed to ",[408,415,403],{"href":416,"rel":417},"https://www.npmjs.com/package/nitro",[412]," (v3).",[386,420,421,425,426,428,429,431,432,435],{},[422,423,424],"strong",{},"Migration:"," Update the ",[397,427,399],{}," dependency to ",[397,430,403],{}," in ",[397,433,434],{},"package.json",":",[437,438,439,489],"CodeGroup",{},[440,441,446],"pre",{"className":442,"code":443,"filename":444,"language":445,"meta":5,"style":5},"language-diff shiki shiki-themes github-light github-dark github-dark","{\n  \"dependencies\": {\n--    \"nitropack\": \"latest\"\n++    \"nitro\": \"latest\"\n  }\n}\n","release channel","diff",[397,447,448,457,463,470,477,483],{"__ignoreMap":5},[449,450,453],"span",{"class":451,"line":452},"line",1,[449,454,456],{"class":455},"slsVL","{\n",[449,458,460],{"class":451,"line":459},2,[449,461,462],{"class":455},"  \"dependencies\": {\n",[449,464,466],{"class":451,"line":465},3,[449,467,469],{"class":468},"sLpD_","--    \"nitropack\": \"latest\"\n",[449,471,473],{"class":451,"line":472},4,[449,474,476],{"class":475},"sByVh","++    \"nitro\": \"latest\"\n",[449,478,480],{"class":451,"line":479},5,[449,481,482],{"class":455},"  }\n",[449,484,486],{"class":451,"line":485},6,[449,487,488],{"class":455},"}\n",[440,490,493],{"className":442,"code":491,"filename":492,"language":445,"meta":5,"style":5},"{\n  \"dependencies\": {\n--    \"nitropack\": \"latest\"\n++    \"nitro\": \"npm:nitro-nightly\"\n  }\n}\n","nightly channel",[397,494,495,499,503,507,512,516],{"__ignoreMap":5},[449,496,497],{"class":451,"line":452},[449,498,456],{"class":455},[449,500,501],{"class":451,"line":459},[449,502,462],{"class":455},[449,504,505],{"class":451,"line":465},[449,506,469],{"class":468},[449,508,509],{"class":451,"line":472},[449,510,511],{"class":475},"++    \"nitro\": \"npm:nitro-nightly\"\n",[449,513,514],{"class":451,"line":479},[449,515,482],{"class":455},[449,517,518],{"class":451,"line":485},[449,519,488],{"class":455},[386,521,522,524],{},[422,523,424],{}," Search your codebase and rename all instances of nitropack to nitro:",[440,526,528],{"className":442,"code":527,"language":445,"meta":5,"style":5},"-- import { defineNitroConfig } from \"nitropack/config\"\n++ import { defineNitroConfig } from \"nitro/config\"\n",[397,529,530,535],{"__ignoreMap":5},[449,531,532],{"class":451,"line":452},[449,533,534],{"class":468},"-- import { defineNitroConfig } from \"nitropack/config\"\n",[449,536,537],{"class":451,"line":459},[449,538,539],{"class":475},"++ import { defineNitroConfig } from \"nitro/config\"\n",[393,541,543],{"id":542},"nitroruntime","nitro/runtime",[386,545,546,547,550],{},"Runtime utils had been moved to individual ",[397,548,549],{},"nitro/*"," subpath exports. Refer to docs for usage.",[440,552,554],{"className":442,"code":553,"language":445,"meta":5,"style":5},"-- import { useStorage } from \"nitropack/runtime/storage\"\n++ import { useStorage } from \"nitro/storage\"\n",[397,555,556,561],{"__ignoreMap":5},[449,557,558],{"class":451,"line":452},[449,559,560],{"class":468},"-- import { useStorage } from \"nitropack/runtime/storage\"\n",[449,562,563],{"class":451,"line":459},[449,564,565],{"class":475},"++ import { useStorage } from \"nitro/storage\"\n",[393,567,569],{"id":568},"minimum-supported-nodejs-version-20","Minimum Supported Node.js Version: 20",[386,571,572,573,578],{},"Nitro now requires a minimum Node.js version of 20, as Node.js 18 reaches end-of-life in ",[408,574,577],{"href":575,"rel":576},"https://nodejs.org/en/about/previous-releases",[412],"April 2025",".",[386,580,581,582,587],{},"Please upgrade to the ",[408,583,586],{"href":584,"rel":585},"https://nodejs.org/en/download",[412],"latest LTS"," version (>= 20).",[386,589,590],{},[422,591,424],{},[593,594,595,603,606],"ul",{},[596,597,598,599,602],"li",{},"Check your local Node.js version using ",[397,600,601],{},"node --version"," and update if necessary.",[596,604,605],{},"If you use a CI/CD system for deployment, ensure that your pipeline is running Node.js 20 or higher.",[596,607,608],{},"If your hosting provider manages the Node.js runtime, make sure it's set to version 20, 22, or later.",[393,610,612],{"id":611},"type-imports","Type Imports",[386,614,615,616,578],{},"Nitro types are now only exported from ",[397,617,618],{},"nitro/types",[386,620,621,623],{},[422,622,424],{}," Import types from nitro/types instead of nitro:",[440,625,627],{"className":442,"code":626,"language":445,"meta":5,"style":5},"-- import { NitroRuntimeConfig } from \"nitropack\"\n++ import { NitroRuntimeConfig } from \"nitro/types\"\n",[397,628,629,634],{"__ignoreMap":5},[449,630,631],{"class":451,"line":452},[449,632,633],{"class":468},"-- import { NitroRuntimeConfig } from \"nitropack\"\n",[449,635,636],{"class":451,"line":459},[449,637,638],{"class":475},"++ import { NitroRuntimeConfig } from \"nitro/types\"\n",[393,640,642],{"id":641},"app-config-support-removed","App Config Support Removed",[386,644,645,646,649,650,578],{},"Nitro v2 supported a bundled app config that allowed defining configurations in ",[397,647,648],{},"app.config.ts"," and accessing them at runtime via ",[397,651,652],{},"useAppConfig()",[386,654,655],{},"This feature had been removed.",[386,657,658],{},[422,659,424],{},[386,661,662,663,666],{},"Use a regular ",[397,664,665],{},".ts"," file in your server directory and import it directly.",[393,668,670],{"id":669},"preset-updates","Preset updates",[386,672,673],{},"Nitro presets have been updated for the latest compatibility.",[386,675,676],{},"Some (legacy) presets have been removed or renamed.",[678,679,680,693],"table",{},[681,682,683],"thead",{},[684,685,686,690],"tr",{},[687,688,689],"th",{},"Old Preset",[687,691,692],{},"New Preset",[694,695,696,714,733,746,762,775,790,802,814,826,836,846],"tbody",{},[684,697,698,704],{},[699,700,701],"td",{},[397,702,703],{},"node",[699,705,706,709,710,713],{},[397,707,708],{},"node_middleware"," (export changed to ",[397,711,712],{},"middleware",")",[684,715,716,728],{},[699,717,718,721,722,721,725],{},[397,719,720],{},"cloudflare",", ",[397,723,724],{},"cloudflare_worker",[397,726,727],{},"cloudflare_module_legacy",[699,729,730],{},[397,731,732],{},"cloudflare_module",[684,734,735,740],{},[699,736,737],{},[397,738,739],{},"deno-server-legacy",[699,741,742,745],{},[397,743,744],{},"deno_server"," with Deno v2",[684,747,748,753],{},[699,749,750],{},[397,751,752],{},"netlify-builder",[699,754,755,758,759],{},[397,756,757],{},"netlify"," or ",[397,760,761],{},"netlify_edge",[684,763,764,769],{},[699,765,766],{},[397,767,768],{},"vercel-edge",[699,770,771,774],{},[397,772,773],{},"vercel"," with Fluid compute enabled",[684,776,777,785],{},[699,778,779,721,782],{},[397,780,781],{},"azure",[397,783,784],{},"azure_functions",[699,786,787],{},[397,788,789],{},"azure_swa",[684,791,792,797],{},[699,793,794],{},[397,795,796],{},"firebase",[699,798,799],{},[397,800,801],{},"firebase_app_hosting",[684,803,804,809],{},[699,805,806],{},[397,807,808],{},"iis",[699,810,811],{},[397,812,813],{},"iis_handler",[684,815,816,821],{},[699,817,818],{},[397,819,820],{},"deno",[699,822,823],{},[397,824,825],{},"deno_deploy",[684,827,828,833],{},[699,829,830],{},[397,831,832],{},"edgio",[699,834,835],{},"Discontinued",[684,837,838,843],{},[699,839,840],{},[397,841,842],{},"cli",[699,844,845],{},"Removed due to lack of use",[684,847,848,853],{},[699,849,850],{},[397,851,852],{},"service_worker",[699,854,855],{},"Removed due to instability",[393,857,859],{"id":858},"cloudflare-bindings-access","Cloudflare Bindings Access",[386,861,862,863,578],{},"In Nitro v2, Cloudflare environment variables and bindings were accessible via ",[397,864,865],{},"event.context.cloudflare.env",[386,867,868],{},"In Nitro v3, the Cloudflare runtime context is attached to the request's runtime object instead.",[386,870,871],{},[422,872,424],{},[440,874,876],{"className":442,"code":875,"language":445,"meta":5,"style":5},"-- const { cloudflare } = event.context\n-- const binding = cloudflare.env.MY_BINDING\n++ const { env } = event.req.runtime.cloudflare\n++ const binding = env.MY_BINDING\n",[397,877,878,883,888,893],{"__ignoreMap":5},[449,879,880],{"class":451,"line":452},[449,881,882],{"class":468},"-- const { cloudflare } = event.context\n",[449,884,885],{"class":451,"line":459},[449,886,887],{"class":468},"-- const binding = cloudflare.env.MY_BINDING\n",[449,889,890],{"class":451,"line":465},[449,891,892],{"class":475},"++ const { env } = event.req.runtime.cloudflare\n",[449,894,895],{"class":451,"line":472},[449,896,897],{"class":475},"++ const binding = env.MY_BINDING\n",[393,899,901],{"id":900},"changed-nitro-subpath-imports","Changed nitro subpath imports",[386,903,904],{},"Nitro v2 introduced multiple subpath exports, some of which have been removed or updated:",[593,906,907,919,926,932],{},[596,908,909,721,912,915,916,713],{},[397,910,911],{},"nitro/rollup",[397,913,914],{},"nitropack/core"," (use ",[397,917,918],{},"nitro/builder",[596,920,921,915,924,713],{},[397,922,923],{},"nitropack/runtime/*",[397,925,549],{},[596,927,928,931],{},[397,929,930],{},"nitropack/kit"," (removed)",[596,933,934,931],{},[397,935,936],{},"nitropack/presets",[386,938,939,940,942],{},"An experimental ",[397,941,930],{}," was introduced but has now been removed. A standalone Nitro Kit package may be introduced in the future with clearer objectives.",[386,944,945],{},[422,946,424],{},[593,948,949,963],{},[596,950,951,952,955,956,958,959,962],{},"Use ",[397,953,954],{},"NitroModule"," from ",[397,957,618],{}," instead of ",[397,960,961],{},"defineNitroModule"," from the kit.",[596,964,965],{},"Prefer built-in Nitro presets (external presets are only for evaluation purposes).",[393,967,969],{"id":968},"h3-v2","H3 v2",[386,971,972,973,977,978,578],{},"Nitro v3 upgrades to ",[408,974,969],{"href":975,"rel":976},"https://h3.dev",[412],", which includes API changes. All H3 utilities are imported from ",[397,979,980],{},"nitro/h3",[982,983,985],"h3",{"id":984},"web-standards","Web Standards",[386,987,988,989,721,996,721,1003,1010,1011,1018],{},"H3 v2 is rewritten based on web standard primitives (",[408,990,993],{"href":991,"rel":992},"https://developer.mozilla.org/en-US/docs/Web/API/URL",[412],[397,994,995],{},"URL",[408,997,1000],{"href":998,"rel":999},"https://developer.mozilla.org/en-US/docs/Web/API/Headers",[412],[397,1001,1002],{},"Headers",[408,1004,1007],{"href":1005,"rel":1006},"https://developer.mozilla.org/en-US/docs/Web/API/Request",[412],[397,1008,1009],{},"Request",", and ",[408,1012,1015],{"href":1013,"rel":1014},"https://developer.mozilla.org/en-US/docs/Web/API/Response",[412],[397,1016,1017],{},"Response",").",[386,1020,1021,1022,1025,1026,400,1029,1032,1033,1018],{},"Access to ",[397,1023,1024],{},"event.node.{req,res}"," is only available in Node.js runtime. ",[397,1027,1028],{},"event.web",[397,1030,1031],{},"event.req"," (instance of web ",[408,1034,1036],{"href":1005,"rel":1035},[412],[397,1037,1009],{},[982,1039,1041],{"id":1040},"response-handling","Response Handling",[386,1043,1044,1045,1048,1049,1052],{},"You should always explicitly ",[422,1046,1047],{},"return"," the response body or ",[422,1050,1051],{},"throw"," an error:",[440,1054,1056],{"className":442,"code":1055,"language":445,"meta":5,"style":5},"-- import { send, sendRedirect, sendStream } from \"nitro/h3\"\n-- send(event, value)\n-- sendStream(event, stream)\n-- sendRedirect(event, location, code)\n++ import { redirect } from \"nitro/h3\"\n++ return value\n++ return stream\n++ return redirect(event, location, code)\n",[397,1057,1058,1063,1068,1073,1078,1083,1088,1094],{"__ignoreMap":5},[449,1059,1060],{"class":451,"line":452},[449,1061,1062],{"class":468},"-- import { send, sendRedirect, sendStream } from \"nitro/h3\"\n",[449,1064,1065],{"class":451,"line":459},[449,1066,1067],{"class":468},"-- send(event, value)\n",[449,1069,1070],{"class":451,"line":465},[449,1071,1072],{"class":468},"-- sendStream(event, stream)\n",[449,1074,1075],{"class":451,"line":472},[449,1076,1077],{"class":468},"-- sendRedirect(event, location, code)\n",[449,1079,1080],{"class":451,"line":479},[449,1081,1082],{"class":475},"++ import { redirect } from \"nitro/h3\"\n",[449,1084,1085],{"class":451,"line":485},[449,1086,1087],{"class":475},"++ return value\n",[449,1089,1091],{"class":451,"line":1090},7,[449,1092,1093],{"class":475},"++ return stream\n",[449,1095,1097],{"class":451,"line":1096},8,[449,1098,1099],{"class":475},"++ return redirect(event, location, code)\n",[386,1101,1102],{},"Other changes:",[593,1104,1105,1114,1122],{},[596,1106,1107,1110,1111],{},[397,1108,1109],{},"sendError(event, error)"," → ",[397,1112,1113],{},"throw createError(error)",[596,1115,1116,1110,1119],{},[397,1117,1118],{},"sendNoContent(event)",[397,1120,1121],{},"return noContent(event)",[596,1123,1124,1110,1127],{},[397,1125,1126],{},"sendProxy(event, target)",[397,1128,1129],{},"return proxy(event, target)",[982,1131,1133],{"id":1132},"request-body","Request Body",[386,1135,1136,1137,1139],{},"Most body utilities can be replaced with native ",[397,1138,1031],{}," methods:",[440,1141,1143],{"className":442,"code":1142,"language":445,"meta":5,"style":5},"-- import { readBody, readRawBody, readFormData } from \"nitro/h3\"\n++ // Use native Request methods\n++ const json = await event.req.json()\n++ const text = await event.req.text()\n++ const formData = await event.req.formData()\n++ const stream = event.req.body\n",[397,1144,1145,1150,1155,1160,1165,1170],{"__ignoreMap":5},[449,1146,1147],{"class":451,"line":452},[449,1148,1149],{"class":468},"-- import { readBody, readRawBody, readFormData } from \"nitro/h3\"\n",[449,1151,1152],{"class":451,"line":459},[449,1153,1154],{"class":475},"++ // Use native Request methods\n",[449,1156,1157],{"class":451,"line":465},[449,1158,1159],{"class":475},"++ const json = await event.req.json()\n",[449,1161,1162],{"class":451,"line":472},[449,1163,1164],{"class":475},"++ const text = await event.req.text()\n",[449,1166,1167],{"class":451,"line":479},[449,1168,1169],{"class":475},"++ const formData = await event.req.formData()\n",[449,1171,1172],{"class":451,"line":485},[449,1173,1174],{"class":475},"++ const stream = event.req.body\n",[982,1176,1002],{"id":1177},"headers",[386,1179,1180,1181,1186,1187,1190,1191,721,1194,1197,1198,1018],{},"H3 now uses standard web ",[408,1182,1184],{"href":998,"rel":1183},[412],[397,1185,1002],{},". Header values are always plain ",[397,1188,1189],{},"string"," (no ",[397,1192,1193],{},"null",[397,1195,1196],{},"undefined",", or ",[397,1199,1200],{},"string[]",[440,1202,1204],{"className":442,"code":1203,"language":445,"meta":5,"style":5},"-- import { getHeader, setHeader, getResponseStatus } from \"nitro/h3\"\n-- getHeader(event, \"x-foo\")\n-- setHeader(event, \"x-foo\", \"bar\")\n++ event.req.headers.get(\"x-foo\")\n++ event.res.headers.set(\"x-foo\", \"bar\")\n++ event.res.status // instead of getResponseStatus(event)\n",[397,1205,1206,1211,1216,1221,1226,1231],{"__ignoreMap":5},[449,1207,1208],{"class":451,"line":452},[449,1209,1210],{"class":468},"-- import { getHeader, setHeader, getResponseStatus } from \"nitro/h3\"\n",[449,1212,1213],{"class":451,"line":459},[449,1214,1215],{"class":468},"-- getHeader(event, \"x-foo\")\n",[449,1217,1218],{"class":451,"line":465},[449,1219,1220],{"class":468},"-- setHeader(event, \"x-foo\", \"bar\")\n",[449,1222,1223],{"class":451,"line":472},[449,1224,1225],{"class":475},"++ event.req.headers.get(\"x-foo\")\n",[449,1227,1228],{"class":451,"line":479},[449,1229,1230],{"class":475},"++ event.res.headers.set(\"x-foo\", \"bar\")\n",[449,1232,1233],{"class":451,"line":485},[449,1234,1235],{"class":475},"++ event.res.status // instead of getResponseStatus(event)\n",[982,1237,1239],{"id":1238},"handler-utils","Handler Utils",[440,1241,1243],{"className":442,"code":1242,"language":445,"meta":5,"style":5},"-- import { eventHandler, defineEventHandler } from \"nitro/h3\"\n++ import { defineHandler } from \"nitro\"\n",[397,1244,1245,1250],{"__ignoreMap":5},[449,1246,1247],{"class":451,"line":452},[449,1248,1249],{"class":468},"-- import { eventHandler, defineEventHandler } from \"nitro/h3\"\n",[449,1251,1252],{"class":451,"line":459},[449,1253,1254],{"class":475},"++ import { defineHandler } from \"nitro\"\n",[593,1256,1257,1265],{},[596,1258,1259,1110,1262],{},[397,1260,1261],{},"lazyEventHandler",[397,1263,1264],{},"defineLazyEventHandler",[596,1266,1267,1110,1270],{},[397,1268,1269],{},"useBase",[397,1271,1272],{},"withBase",[982,1274,1276],{"id":1275},"error-utils","Error Utils",[440,1278,1280],{"className":442,"code":1279,"language":445,"meta":5,"style":5},"-- import { createError, isError } from \"nitro/h3\"\n++ import { HTTPError } from \"nitro\"\n++ throw new HTTPError({ status: 404, message: \"Not found\" })\n++ HTTPError.isError(error)\n",[397,1281,1282,1287,1292,1297],{"__ignoreMap":5},[449,1283,1284],{"class":451,"line":452},[449,1285,1286],{"class":468},"-- import { createError, isError } from \"nitro/h3\"\n",[449,1288,1289],{"class":451,"line":459},[449,1290,1291],{"class":475},"++ import { HTTPError } from \"nitro\"\n",[449,1293,1294],{"class":451,"line":465},[449,1295,1296],{"class":475},"++ throw new HTTPError({ status: 404, message: \"Not found\" })\n",[449,1298,1299],{"class":451,"line":472},[449,1300,1301],{"class":475},"++ HTTPError.isError(error)\n",[982,1303,1305],{"id":1304},"nodejs-utils","Node.js Utils",[440,1307,1309],{"className":442,"code":1308,"language":445,"meta":5,"style":5},"-- import { defineNodeListener, fromNodeMiddleware, toNodeListener } from \"nitro/h3\"\n++ import { defineNodeHandler, fromNodeHandler, toNodeHandler } from \"nitro/h3\"\n",[397,1310,1311,1316],{"__ignoreMap":5},[449,1312,1313],{"class":451,"line":452},[449,1314,1315],{"class":468},"-- import { defineNodeListener, fromNodeMiddleware, toNodeListener } from \"nitro/h3\"\n",[449,1317,1318],{"class":451,"line":459},[449,1319,1320],{"class":475},"++ import { defineNodeHandler, fromNodeHandler, toNodeHandler } from \"nitro/h3\"\n",[393,1322,1324],{"id":1323},"optional-hooks","Optional Hooks",[386,1326,1327,1328,1331,1332,1335],{},"If you were using ",[397,1329,1330],{},"useNitroApp().hooks"," outside of Nitro plugins before, it might be undefined. Use new ",[397,1333,1334],{},"useNitroHooks()"," to guarantee having an instance.",[1337,1338,1339],"style",{},"html pre.shiki code .slsVL, html code.shiki .slsVL{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .sLpD_, html code.shiki .sLpD_{--shiki-light:#B31D28;--shiki-default:#FDAEB7;--shiki-dark:#FDAEB7}html pre.shiki code .sByVh, html code.shiki .sByVh{--shiki-light:#22863A;--shiki-default:#85E89D;--shiki-dark:#85E89D}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);}",{"title":5,"searchDepth":459,"depth":459,"links":1341},[1342,1344,1345,1346,1347,1348,1349,1350,1351,1360],{"id":395,"depth":459,"text":1343},"nitropack is renamed to nitro",{"id":542,"depth":459,"text":543},{"id":568,"depth":459,"text":569},{"id":611,"depth":459,"text":612},{"id":641,"depth":459,"text":642},{"id":669,"depth":459,"text":670},{"id":858,"depth":459,"text":859},{"id":900,"depth":459,"text":901},{"id":968,"depth":459,"text":969,"children":1352},[1353,1354,1355,1356,1357,1358,1359],{"id":984,"depth":465,"text":985},{"id":1040,"depth":465,"text":1041},{"id":1132,"depth":465,"text":1133},{"id":1177,"depth":465,"text":1002},{"id":1238,"depth":465,"text":1239},{"id":1275,"depth":465,"text":1276},{"id":1304,"depth":465,"text":1305},{"id":1323,"depth":459,"text":1324},"md",{"icon":76},{"icon":76},{"title":73,"description":5},"p5Pbx6cL999eLbeBYnDfEMP6kwSuBY4Zop3IcZ3NMW4",[1367,1369],{"title":68,"path":69,"stem":70,"description":1368,"icon":71,"children":-1},"Nitro provides a built-in storage layer that can abstract filesystem or database or any other data source.",{"title":78,"path":79,"stem":80,"description":1370,"icon":81,"children":-1},"Nitro has a nightly release channel that automatically releases for every commit to main branch to try latest changes.",1773242047845]