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