[{"data":1,"prerenderedAt":1388},["ShallowReactive",2],{"navigation":3,"-docs-migration":394,"-docs-migration-surround":1383},[4,88,217,223,379,391],{"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},"OpenAPI","/docs/openapi","1.docs/50.openapi","ri:contract-line",{"title":53,"path":54,"stem":55,"icon":56},"Plugins","/docs/plugins","1.docs/50.plugins","ri:plug-line",{"title":58,"path":59,"stem":60,"icon":61},"Tasks","/docs/tasks","1.docs/50.tasks","codicon:run-all",{"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":53,"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":375,"path":376,"stem":377,"icon":378},"WebSocket","/examples/websocket","4.examples/websocket","i-lucide-radio",{"title":380,"path":381,"stem":382,"children":383},"Blog","/blog","9.blog",[384,387],{"title":380,"path":381,"stem":385,"icon":386},"9.blog/index","i-lucide-file-text",{"title":388,"path":389,"stem":390,"icon":386},"Nitro v3 Beta is here!","/blog/v3-beta","9.blog/1.v3-beta",{"title":5,"path":392,"stem":393},"/","index",{"id":395,"title":78,"body":396,"description":5,"extension":1378,"meta":1379,"navigation":1380,"path":79,"seo":1381,"stem":80,"__hash__":1382},"content/1.docs/99.migration.md",{"type":397,"value":398,"toc":1357,"icon":81},"minimark",[399,406,409,421,436,453,537,542,557,561,568,583,587,596,605,609,626,630,636,641,656,660,670,673,677,684,688,691,694,873,877,883,886,890,915,919,922,954,960,964,983,987,998,1003,1036,1055,1059,1070,1117,1120,1147,1151,1157,1192,1195,1218,1253,1257,1272,1290,1294,1319,1323,1338,1342,1353],[400,401,402],"note",{},[403,404,405],"p",{},"\nThis is a living document for migrating from Nitro 2 to 3. Please check it regularly while using the beta version.",[403,407,408],{},"Nitro v3 introduces intentional backward-incompatible changes. This guide helps you migrate from Nitro v2.",[410,411,413,417,418],"h2",{"id":412},"nitropack-is-renamed-to-nitro",[414,415,416],"code",{},"nitropack"," is renamed to ",[414,419,420],{},"nitro",[403,422,423,424,430,431,435],{},"The NPM package ",[425,426,416],"a",{"href":427,"rel":428},"https://www.npmjs.com/package/nitropack",[429],"nofollow"," (v2) has been renamed to ",[425,432,420],{"href":433,"rel":434},"https://www.npmjs.com/package/nitro",[429]," (v3).",[403,437,438,442,443,445,446,448,449,452],{},[439,440,441],"strong",{},"Migration:"," Update the ",[414,444,416],{}," dependency to ",[414,447,420],{}," in ",[414,450,451],{},"package.json",":",[454,455,456,506],"CodeGroup",{},[457,458,463],"pre",{"className":459,"code":460,"filename":461,"language":462,"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",[414,464,465,474,480,487,494,500],{"__ignoreMap":5},[466,467,470],"span",{"class":468,"line":469},"line",1,[466,471,473],{"class":472},"slsVL","{\n",[466,475,477],{"class":468,"line":476},2,[466,478,479],{"class":472},"  \"dependencies\": {\n",[466,481,483],{"class":468,"line":482},3,[466,484,486],{"class":485},"sLpD_","--    \"nitropack\": \"latest\"\n",[466,488,490],{"class":468,"line":489},4,[466,491,493],{"class":492},"sByVh","++    \"nitro\": \"latest\"\n",[466,495,497],{"class":468,"line":496},5,[466,498,499],{"class":472},"  }\n",[466,501,503],{"class":468,"line":502},6,[466,504,505],{"class":472},"}\n",[457,507,510],{"className":459,"code":508,"filename":509,"language":462,"meta":5,"style":5},"{\n  \"dependencies\": {\n--    \"nitropack\": \"latest\"\n++    \"nitro\": \"npm:nitro-nightly\"\n  }\n}\n","nightly channel",[414,511,512,516,520,524,529,533],{"__ignoreMap":5},[466,513,514],{"class":468,"line":469},[466,515,473],{"class":472},[466,517,518],{"class":468,"line":476},[466,519,479],{"class":472},[466,521,522],{"class":468,"line":482},[466,523,486],{"class":485},[466,525,526],{"class":468,"line":489},[466,527,528],{"class":492},"++    \"nitro\": \"npm:nitro-nightly\"\n",[466,530,531],{"class":468,"line":496},[466,532,499],{"class":472},[466,534,535],{"class":468,"line":502},[466,536,505],{"class":472},[403,538,539,541],{},[439,540,441],{}," Search your codebase and rename all instances of nitropack to nitro:",[457,543,545],{"className":459,"code":544,"language":462,"meta":5,"style":5},"-- import { defineNitroConfig } from \"nitropack/config\"\n++ import { defineNitroConfig } from \"nitro/config\"\n",[414,546,547,552],{"__ignoreMap":5},[466,548,549],{"class":468,"line":469},[466,550,551],{"class":485},"-- import { defineNitroConfig } from \"nitropack/config\"\n",[466,553,554],{"class":468,"line":476},[466,555,556],{"class":492},"++ import { defineNitroConfig } from \"nitro/config\"\n",[410,558,560],{"id":559},"nitroruntime","nitro/runtime",[403,562,563,564,567],{},"Runtime utils had been moved to individual ",[414,565,566],{},"nitro/*"," subpath exports. Refer to docs for usage.",[457,569,571],{"className":459,"code":570,"language":462,"meta":5,"style":5},"-- import { useStorage } from \"nitropack/runtime/storage\"\n++ import { useStorage } from \"nitro/storage\"\n",[414,572,573,578],{"__ignoreMap":5},[466,574,575],{"class":468,"line":469},[466,576,577],{"class":485},"-- import { useStorage } from \"nitropack/runtime/storage\"\n",[466,579,580],{"class":468,"line":476},[466,581,582],{"class":492},"++ import { useStorage } from \"nitro/storage\"\n",[410,584,586],{"id":585},"minimum-supported-nodejs-version-20","Minimum Supported Node.js Version: 20",[403,588,589,590,595],{},"Nitro now requires a minimum Node.js version of 20, as Node.js 18 reaches end-of-life in ",[425,591,594],{"href":592,"rel":593},"https://nodejs.org/en/about/previous-releases",[429],"April 2025",".",[403,597,598,599,604],{},"Please upgrade to the ",[425,600,603],{"href":601,"rel":602},"https://nodejs.org/en/download",[429],"latest LTS"," version (>= 20).",[403,606,607],{},[439,608,441],{},[610,611,612,620,623],"ul",{},[613,614,615,616,619],"li",{},"Check your local Node.js version using ",[414,617,618],{},"node --version"," and update if necessary.",[613,621,622],{},"If you use a CI/CD system for deployment, ensure that your pipeline is running Node.js 20 or higher.",[613,624,625],{},"If your hosting provider manages the Node.js runtime, make sure it's set to version 20, 22, or later.",[410,627,629],{"id":628},"type-imports","Type Imports",[403,631,632,633,595],{},"Nitro types are now only exported from ",[414,634,635],{},"nitro/types",[403,637,638,640],{},[439,639,441],{}," Import types from nitro/types instead of nitro:",[457,642,644],{"className":459,"code":643,"language":462,"meta":5,"style":5},"-- import { NitroRuntimeConfig } from \"nitropack\"\n++ import { NitroRuntimeConfig } from \"nitro/types\"\n",[414,645,646,651],{"__ignoreMap":5},[466,647,648],{"class":468,"line":469},[466,649,650],{"class":485},"-- import { NitroRuntimeConfig } from \"nitropack\"\n",[466,652,653],{"class":468,"line":476},[466,654,655],{"class":492},"++ import { NitroRuntimeConfig } from \"nitro/types\"\n",[410,657,659],{"id":658},"app-config-support-removed","App Config Support Removed",[403,661,662,663,666,667,595],{},"Nitro v2 supported a bundled app config that allowed defining configurations in ",[414,664,665],{},"app.config.ts"," and accessing them at runtime via ",[414,668,669],{},"useAppConfig()",[403,671,672],{},"This feature had been removed.",[403,674,675],{},[439,676,441],{},[403,678,679,680,683],{},"Use a regular ",[414,681,682],{},".ts"," file in your server directory and import it directly.",[410,685,687],{"id":686},"preset-updates","Preset updates",[403,689,690],{},"Nitro presets have been updated for the latest compatibility.",[403,692,693],{},"Some (legacy) presets have been removed or renamed.",[695,696,697,710],"table",{},[698,699,700],"thead",{},[701,702,703,707],"tr",{},[704,705,706],"th",{},"Old Preset",[704,708,709],{},"New Preset",[711,712,713,731,750,763,779,792,807,819,831,843,853,863],"tbody",{},[701,714,715,721],{},[716,717,718],"td",{},[414,719,720],{},"node",[716,722,723,726,727,730],{},[414,724,725],{},"node_middleware"," (export changed to ",[414,728,729],{},"middleware",")",[701,732,733,745],{},[716,734,735,738,739,738,742],{},[414,736,737],{},"cloudflare",", ",[414,740,741],{},"cloudflare_worker",[414,743,744],{},"cloudflare_module_legacy",[716,746,747],{},[414,748,749],{},"cloudflare_module",[701,751,752,757],{},[716,753,754],{},[414,755,756],{},"deno-server-legacy",[716,758,759,762],{},[414,760,761],{},"deno_server"," with Deno v2",[701,764,765,770],{},[716,766,767],{},[414,768,769],{},"netlify-builder",[716,771,772,775,776],{},[414,773,774],{},"netlify"," or ",[414,777,778],{},"netlify_edge",[701,780,781,786],{},[716,782,783],{},[414,784,785],{},"vercel-edge",[716,787,788,791],{},[414,789,790],{},"vercel"," with Fluid compute enabled",[701,793,794,802],{},[716,795,796,738,799],{},[414,797,798],{},"azure",[414,800,801],{},"azure_functions",[716,803,804],{},[414,805,806],{},"azure_swa",[701,808,809,814],{},[716,810,811],{},[414,812,813],{},"firebase",[716,815,816],{},[414,817,818],{},"firebase_app_hosting",[701,820,821,826],{},[716,822,823],{},[414,824,825],{},"iis",[716,827,828],{},[414,829,830],{},"iis_handler",[701,832,833,838],{},[716,834,835],{},[414,836,837],{},"deno",[716,839,840],{},[414,841,842],{},"deno_deploy",[701,844,845,850],{},[716,846,847],{},[414,848,849],{},"edgio",[716,851,852],{},"Discontinued",[701,854,855,860],{},[716,856,857],{},[414,858,859],{},"cli",[716,861,862],{},"Removed due to lack of use",[701,864,865,870],{},[716,866,867],{},[414,868,869],{},"service_worker",[716,871,872],{},"Removed due to instability",[410,874,876],{"id":875},"cloudflare-bindings-access","Cloudflare Bindings Access",[403,878,879,880,595],{},"In Nitro v2, Cloudflare environment variables and bindings were accessible via ",[414,881,882],{},"event.context.cloudflare.env",[403,884,885],{},"In Nitro v3, the Cloudflare runtime context is attached to the request's runtime object instead.",[403,887,888],{},[439,889,441],{},[457,891,893],{"className":459,"code":892,"language":462,"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",[414,894,895,900,905,910],{"__ignoreMap":5},[466,896,897],{"class":468,"line":469},[466,898,899],{"class":485},"-- const { cloudflare } = event.context\n",[466,901,902],{"class":468,"line":476},[466,903,904],{"class":485},"-- const binding = cloudflare.env.MY_BINDING\n",[466,906,907],{"class":468,"line":482},[466,908,909],{"class":492},"++ const { env } = event.req.runtime.cloudflare\n",[466,911,912],{"class":468,"line":489},[466,913,914],{"class":492},"++ const binding = env.MY_BINDING\n",[410,916,918],{"id":917},"changed-nitro-subpath-imports","Changed nitro subpath imports",[403,920,921],{},"Nitro v2 introduced multiple subpath exports, some of which have been removed or updated:",[610,923,924,936,943,949],{},[613,925,926,738,929,932,933,730],{},[414,927,928],{},"nitro/rollup",[414,930,931],{},"nitropack/core"," (use ",[414,934,935],{},"nitro/builder",[613,937,938,932,941,730],{},[414,939,940],{},"nitropack/runtime/*",[414,942,566],{},[613,944,945,948],{},[414,946,947],{},"nitropack/kit"," (removed)",[613,950,951,948],{},[414,952,953],{},"nitropack/presets",[403,955,956,957,959],{},"An experimental ",[414,958,947],{}," was introduced but has now been removed. A standalone Nitro Kit package may be introduced in the future with clearer objectives.",[403,961,962],{},[439,963,441],{},[610,965,966,980],{},[613,967,968,969,972,973,975,976,979],{},"Use ",[414,970,971],{},"NitroModule"," from ",[414,974,635],{}," instead of ",[414,977,978],{},"defineNitroModule"," from the kit.",[613,981,982],{},"Prefer built-in Nitro presets (external presets are only for evaluation purposes).",[410,984,986],{"id":985},"h3-v2","H3 v2",[403,988,989,990,994,995,595],{},"Nitro v3 upgrades to ",[425,991,986],{"href":992,"rel":993},"https://h3.dev",[429],", which includes API changes. All H3 utilities are imported from ",[414,996,997],{},"nitro/h3",[999,1000,1002],"h3",{"id":1001},"web-standards","Web Standards",[403,1004,1005,1006,738,1013,738,1020,1027,1028,1035],{},"H3 v2 is rewritten based on web standard primitives (",[425,1007,1010],{"href":1008,"rel":1009},"https://developer.mozilla.org/en-US/docs/Web/API/URL",[429],[414,1011,1012],{},"URL",[425,1014,1017],{"href":1015,"rel":1016},"https://developer.mozilla.org/en-US/docs/Web/API/Headers",[429],[414,1018,1019],{},"Headers",[425,1021,1024],{"href":1022,"rel":1023},"https://developer.mozilla.org/en-US/docs/Web/API/Request",[429],[414,1025,1026],{},"Request",", and ",[425,1029,1032],{"href":1030,"rel":1031},"https://developer.mozilla.org/en-US/docs/Web/API/Response",[429],[414,1033,1034],{},"Response",").",[403,1037,1038,1039,1042,1043,417,1046,1049,1050,1035],{},"Access to ",[414,1040,1041],{},"event.node.{req,res}"," is only available in Node.js runtime. ",[414,1044,1045],{},"event.web",[414,1047,1048],{},"event.req"," (instance of web ",[425,1051,1053],{"href":1022,"rel":1052},[429],[414,1054,1026],{},[999,1056,1058],{"id":1057},"response-handling","Response Handling",[403,1060,1061,1062,1065,1066,1069],{},"You should always explicitly ",[439,1063,1064],{},"return"," the response body or ",[439,1067,1068],{},"throw"," an error:",[457,1071,1073],{"className":459,"code":1072,"language":462,"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",[414,1074,1075,1080,1085,1090,1095,1100,1105,1111],{"__ignoreMap":5},[466,1076,1077],{"class":468,"line":469},[466,1078,1079],{"class":485},"-- import { send, sendRedirect, sendStream } from \"nitro/h3\"\n",[466,1081,1082],{"class":468,"line":476},[466,1083,1084],{"class":485},"-- send(event, value)\n",[466,1086,1087],{"class":468,"line":482},[466,1088,1089],{"class":485},"-- sendStream(event, stream)\n",[466,1091,1092],{"class":468,"line":489},[466,1093,1094],{"class":485},"-- sendRedirect(event, location, code)\n",[466,1096,1097],{"class":468,"line":496},[466,1098,1099],{"class":492},"++ import { redirect } from \"nitro/h3\"\n",[466,1101,1102],{"class":468,"line":502},[466,1103,1104],{"class":492},"++ return value\n",[466,1106,1108],{"class":468,"line":1107},7,[466,1109,1110],{"class":492},"++ return stream\n",[466,1112,1114],{"class":468,"line":1113},8,[466,1115,1116],{"class":492},"++ return redirect(event, location, code)\n",[403,1118,1119],{},"Other changes:",[610,1121,1122,1131,1139],{},[613,1123,1124,1127,1128],{},[414,1125,1126],{},"sendError(event, error)"," → ",[414,1129,1130],{},"throw createError(error)",[613,1132,1133,1127,1136],{},[414,1134,1135],{},"sendNoContent(event)",[414,1137,1138],{},"return noContent(event)",[613,1140,1141,1127,1144],{},[414,1142,1143],{},"sendProxy(event, target)",[414,1145,1146],{},"return proxy(event, target)",[999,1148,1150],{"id":1149},"request-body","Request Body",[403,1152,1153,1154,1156],{},"Most body utilities can be replaced with native ",[414,1155,1048],{}," methods:",[457,1158,1160],{"className":459,"code":1159,"language":462,"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",[414,1161,1162,1167,1172,1177,1182,1187],{"__ignoreMap":5},[466,1163,1164],{"class":468,"line":469},[466,1165,1166],{"class":485},"-- import { readBody, readRawBody, readFormData } from \"nitro/h3\"\n",[466,1168,1169],{"class":468,"line":476},[466,1170,1171],{"class":492},"++ // Use native Request methods\n",[466,1173,1174],{"class":468,"line":482},[466,1175,1176],{"class":492},"++ const json = await event.req.json()\n",[466,1178,1179],{"class":468,"line":489},[466,1180,1181],{"class":492},"++ const text = await event.req.text()\n",[466,1183,1184],{"class":468,"line":496},[466,1185,1186],{"class":492},"++ const formData = await event.req.formData()\n",[466,1188,1189],{"class":468,"line":502},[466,1190,1191],{"class":492},"++ const stream = event.req.body\n",[999,1193,1019],{"id":1194},"headers",[403,1196,1197,1198,1203,1204,1207,1208,738,1211,1214,1215,1035],{},"H3 now uses standard web ",[425,1199,1201],{"href":1015,"rel":1200},[429],[414,1202,1019],{},". Header values are always plain ",[414,1205,1206],{},"string"," (no ",[414,1209,1210],{},"null",[414,1212,1213],{},"undefined",", or ",[414,1216,1217],{},"string[]",[457,1219,1221],{"className":459,"code":1220,"language":462,"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",[414,1222,1223,1228,1233,1238,1243,1248],{"__ignoreMap":5},[466,1224,1225],{"class":468,"line":469},[466,1226,1227],{"class":485},"-- import { getHeader, setHeader, getResponseStatus } from \"nitro/h3\"\n",[466,1229,1230],{"class":468,"line":476},[466,1231,1232],{"class":485},"-- getHeader(event, \"x-foo\")\n",[466,1234,1235],{"class":468,"line":482},[466,1236,1237],{"class":485},"-- setHeader(event, \"x-foo\", \"bar\")\n",[466,1239,1240],{"class":468,"line":489},[466,1241,1242],{"class":492},"++ event.req.headers.get(\"x-foo\")\n",[466,1244,1245],{"class":468,"line":496},[466,1246,1247],{"class":492},"++ event.res.headers.set(\"x-foo\", \"bar\")\n",[466,1249,1250],{"class":468,"line":502},[466,1251,1252],{"class":492},"++ event.res.status // instead of getResponseStatus(event)\n",[999,1254,1256],{"id":1255},"handler-utils","Handler Utils",[457,1258,1260],{"className":459,"code":1259,"language":462,"meta":5,"style":5},"-- import { eventHandler, defineEventHandler } from \"nitro/h3\"\n++ import { defineHandler } from \"nitro\"\n",[414,1261,1262,1267],{"__ignoreMap":5},[466,1263,1264],{"class":468,"line":469},[466,1265,1266],{"class":485},"-- import { eventHandler, defineEventHandler } from \"nitro/h3\"\n",[466,1268,1269],{"class":468,"line":476},[466,1270,1271],{"class":492},"++ import { defineHandler } from \"nitro\"\n",[610,1273,1274,1282],{},[613,1275,1276,1127,1279],{},[414,1277,1278],{},"lazyEventHandler",[414,1280,1281],{},"defineLazyEventHandler",[613,1283,1284,1127,1287],{},[414,1285,1286],{},"useBase",[414,1288,1289],{},"withBase",[999,1291,1293],{"id":1292},"error-utils","Error Utils",[457,1295,1297],{"className":459,"code":1296,"language":462,"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",[414,1298,1299,1304,1309,1314],{"__ignoreMap":5},[466,1300,1301],{"class":468,"line":469},[466,1302,1303],{"class":485},"-- import { createError, isError } from \"nitro/h3\"\n",[466,1305,1306],{"class":468,"line":476},[466,1307,1308],{"class":492},"++ import { HTTPError } from \"nitro\"\n",[466,1310,1311],{"class":468,"line":482},[466,1312,1313],{"class":492},"++ throw new HTTPError({ status: 404, message: \"Not found\" })\n",[466,1315,1316],{"class":468,"line":489},[466,1317,1318],{"class":492},"++ HTTPError.isError(error)\n",[999,1320,1322],{"id":1321},"nodejs-utils","Node.js Utils",[457,1324,1326],{"className":459,"code":1325,"language":462,"meta":5,"style":5},"-- import { defineNodeListener, fromNodeMiddleware, toNodeListener } from \"nitro/h3\"\n++ import { defineNodeHandler, fromNodeHandler, toNodeHandler } from \"nitro/h3\"\n",[414,1327,1328,1333],{"__ignoreMap":5},[466,1329,1330],{"class":468,"line":469},[466,1331,1332],{"class":485},"-- import { defineNodeListener, fromNodeMiddleware, toNodeListener } from \"nitro/h3\"\n",[466,1334,1335],{"class":468,"line":476},[466,1336,1337],{"class":492},"++ import { defineNodeHandler, fromNodeHandler, toNodeHandler } from \"nitro/h3\"\n",[410,1339,1341],{"id":1340},"optional-hooks","Optional Hooks",[403,1343,1344,1345,1348,1349,1352],{},"If you were using ",[414,1346,1347],{},"useNitroApp().hooks"," outside of Nitro plugins before, it might be undefined. Use new ",[414,1350,1351],{},"useNitroHooks()"," to guarantee having an instance.",[1354,1355,1356],"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":476,"depth":476,"links":1358},[1359,1361,1362,1363,1364,1365,1366,1367,1368,1377],{"id":412,"depth":476,"text":1360},"nitropack is renamed to nitro",{"id":559,"depth":476,"text":560},{"id":585,"depth":476,"text":586},{"id":628,"depth":476,"text":629},{"id":658,"depth":476,"text":659},{"id":686,"depth":476,"text":687},{"id":875,"depth":476,"text":876},{"id":917,"depth":476,"text":918},{"id":985,"depth":476,"text":986,"children":1369},[1370,1371,1372,1373,1374,1375,1376],{"id":1001,"depth":482,"text":1002},{"id":1057,"depth":482,"text":1058},{"id":1149,"depth":482,"text":1150},{"id":1194,"depth":482,"text":1019},{"id":1255,"depth":482,"text":1256},{"id":1292,"depth":482,"text":1293},{"id":1321,"depth":482,"text":1322},{"id":1340,"depth":476,"text":1341},"md",{"icon":81},{"icon":81},{"title":78,"description":5},"p5Pbx6cL999eLbeBYnDfEMP6kwSuBY4Zop3IcZ3NMW4",[1384,1386],{"title":73,"path":74,"stem":75,"description":1385,"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":1387,"icon":86,"children":-1},"Nitro has a nightly release channel that automatically releases for every commit to main branch to try latest changes.",1775834864659]