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