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