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