[{"data":1,"prerenderedAt":2280},["ShallowReactive",2],{"navigation":3,"-docs-migration":445,"-docs-migration-surround":2275},[4,123,260,266,430,442],{"title":5,"path":6,"stem":7,"children":8,"icon":122},"","\u002Fdocs","1.docs\u002F1.index",[9,12,17,22,27,32,37,42,47,52,57,62,67,72,77,82,87,92,97,102,107,112,117],{"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},"Prerendering","\u002Fdocs\u002Fprerendering","1.docs\u002F50.prerendering","ri:file-copy-2-line",{"title":63,"path":64,"stem":65,"icon":66},"Tasks","\u002Fdocs\u002Ftasks","1.docs\u002F50.tasks","codicon:run-all",{"title":68,"path":69,"stem":70,"icon":71},"WebSocket","\u002Fdocs\u002Fwebsocket","1.docs\u002F50.websocket","ri:broadcast-fill",{"title":73,"path":74,"stem":75,"icon":76},"Modules","\u002Fdocs\u002Fmodules","1.docs\u002F55.modules","i-lucide-puzzle",{"title":78,"path":79,"stem":80,"icon":81},"Server Entry","\u002Fdocs\u002Fserver-entry","1.docs\u002F6.server-entry","ri:server-line",{"title":83,"path":84,"stem":85,"icon":86},"CLI","\u002Fdocs\u002Fcli","1.docs\u002F60.cli","i-lucide-terminal",{"title":88,"path":89,"stem":90,"icon":91},"Vite","\u002Fdocs\u002Fvite","1.docs\u002F61.vite","i-logos-vitejs",{"title":93,"path":94,"stem":95,"icon":96},"Utils","\u002Fdocs\u002Futils","1.docs\u002F62.utils","i-lucide-braces",{"title":98,"path":99,"stem":100,"icon":101},"TypeScript","\u002Fdocs\u002Ftypescript","1.docs\u002F63.typescript","i-logos-typescript-icon",{"title":103,"path":104,"stem":105,"icon":106},"Cache","\u002Fdocs\u002Fcache","1.docs\u002F7.cache","ri:speed-line",{"title":108,"path":109,"stem":110,"icon":111},"KV Storage","\u002Fdocs\u002Fstorage","1.docs\u002F8.storage","carbon:datastore",{"title":113,"path":114,"stem":115,"icon":116},"Migration Guide","\u002Fdocs\u002Fmigration","1.docs\u002F99.migration","ri:arrow-right-up-line",{"title":118,"path":119,"stem":120,"icon":121},"Nightly Channel","\u002Fdocs\u002Fnightly","1.docs\u002F99.nightly","ri:moon-fill","i-lucide-book-open",{"title":124,"path":125,"stem":126,"children":127,"icon":129},"Deploy","\u002Fdeploy","2.deploy\u002F0.index",[128,130,155],{"title":124,"path":125,"stem":126,"icon":129},"ri:upload-cloud-2-line",{"title":131,"path":132,"stem":133,"children":134,"page":154},"Runtimes","\u002Fdeploy\u002Fruntimes","2.deploy\u002F10.runtimes",[135,140,145,150],{"title":136,"path":137,"stem":138,"icon":139},"Node.js","\u002Fdeploy\u002Fruntimes\u002Fnode","2.deploy\u002F10.runtimes\u002F1.node","akar-icons:node-fill",{"title":141,"path":142,"stem":143,"icon":144},"Bun","\u002Fdeploy\u002Fruntimes\u002Fbun","2.deploy\u002F10.runtimes\u002Fbun","simple-icons:bun",{"title":146,"path":147,"stem":148,"icon":149},"Deno","\u002Fdeploy\u002Fruntimes\u002Fdeno","2.deploy\u002F10.runtimes\u002Fdeno","simple-icons:deno",{"title":151,"path":152,"stem":153},"Standard","\u002Fdeploy\u002Fruntimes\u002Fstandard","2.deploy\u002F10.runtimes\u002Fstandard",false,{"title":156,"path":157,"stem":158,"children":159,"page":154},"Providers","\u002Fdeploy\u002Fproviders","2.deploy\u002F20.providers",[160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,256],{"title":161,"path":162,"stem":163},"Alwaysdata","\u002Fdeploy\u002Fproviders\u002Falwaysdata","2.deploy\u002F20.providers\u002Falwaysdata",{"title":165,"path":166,"stem":167},"AWS Lambda","\u002Fdeploy\u002Fproviders\u002Faws","2.deploy\u002F20.providers\u002Faws",{"title":169,"path":170,"stem":171},"AWS Amplify","\u002Fdeploy\u002Fproviders\u002Faws-amplify","2.deploy\u002F20.providers\u002Faws-amplify",{"title":173,"path":174,"stem":175},"Azure","\u002Fdeploy\u002Fproviders\u002Fazure","2.deploy\u002F20.providers\u002Fazure",{"title":177,"path":178,"stem":179},"Cleavr","\u002Fdeploy\u002Fproviders\u002Fcleavr","2.deploy\u002F20.providers\u002Fcleavr",{"title":181,"path":182,"stem":183},"Cloudflare","\u002Fdeploy\u002Fproviders\u002Fcloudflare","2.deploy\u002F20.providers\u002Fcloudflare",{"title":185,"path":186,"stem":187},"Deno Deploy","\u002Fdeploy\u002Fproviders\u002Fdeno-deploy","2.deploy\u002F20.providers\u002Fdeno-deploy",{"title":189,"path":190,"stem":191},"DigitalOcean","\u002Fdeploy\u002Fproviders\u002Fdigitalocean","2.deploy\u002F20.providers\u002Fdigitalocean",{"title":193,"path":194,"stem":195},"EdgeOne Pages","\u002Fdeploy\u002Fproviders\u002Fedgeone","2.deploy\u002F20.providers\u002Fedgeone",{"title":197,"path":198,"stem":199},"Firebase","\u002Fdeploy\u002Fproviders\u002Ffirebase","2.deploy\u002F20.providers\u002Ffirebase",{"title":201,"path":202,"stem":203},"Flightcontrol","\u002Fdeploy\u002Fproviders\u002Fflightcontrol","2.deploy\u002F20.providers\u002Fflightcontrol",{"title":205,"path":206,"stem":207},"Genezio","\u002Fdeploy\u002Fproviders\u002Fgenezio","2.deploy\u002F20.providers\u002Fgenezio",{"title":209,"path":210,"stem":211},"GitHub Pages","\u002Fdeploy\u002Fproviders\u002Fgithub-pages","2.deploy\u002F20.providers\u002Fgithub-pages",{"title":213,"path":214,"stem":215},"GitLab Pages","\u002Fdeploy\u002Fproviders\u002Fgitlab-pages","2.deploy\u002F20.providers\u002Fgitlab-pages",{"title":217,"path":218,"stem":219},"Heroku","\u002Fdeploy\u002Fproviders\u002Fheroku","2.deploy\u002F20.providers\u002Fheroku",{"title":221,"path":222,"stem":223},"IIS","\u002Fdeploy\u002Fproviders\u002Fiis","2.deploy\u002F20.providers\u002Fiis",{"title":225,"path":226,"stem":227},"Koyeb","\u002Fdeploy\u002Fproviders\u002Fkoyeb","2.deploy\u002F20.providers\u002Fkoyeb",{"title":229,"path":230,"stem":231},"Netlify","\u002Fdeploy\u002Fproviders\u002Fnetlify","2.deploy\u002F20.providers\u002Fnetlify",{"title":233,"path":234,"stem":235},"Platform.sh","\u002Fdeploy\u002Fproviders\u002Fplatform-sh","2.deploy\u002F20.providers\u002Fplatform-sh",{"title":237,"path":238,"stem":239},"Render.com","\u002Fdeploy\u002Fproviders\u002Frender","2.deploy\u002F20.providers\u002Frender",{"title":241,"path":242,"stem":243},"Stormkit","\u002Fdeploy\u002Fproviders\u002Fstormkit","2.deploy\u002F20.providers\u002Fstormkit",{"title":245,"path":246,"stem":247},"Vercel","\u002Fdeploy\u002Fproviders\u002Fvercel","2.deploy\u002F20.providers\u002Fvercel",{"title":249,"path":250,"stem":251},"Zeabur","\u002Fdeploy\u002Fproviders\u002Fzeabur","2.deploy\u002F20.providers\u002Fzeabur",{"title":253,"path":254,"stem":255},"Zephyr Cloud","\u002Fdeploy\u002Fproviders\u002Fzephyr","2.deploy\u002F20.providers\u002Fzephyr",{"title":257,"path":258,"stem":259},"Zerops","\u002Fdeploy\u002Fproviders\u002Fzerops","2.deploy\u002F20.providers\u002Fzerops",{"title":261,"path":262,"stem":263,"children":264,"icon":36},"Config","\u002Fconfig","3.config\u002F0.index",[265],{"title":261,"path":262,"stem":263,"icon":36},{"title":267,"path":268,"stem":269,"children":270,"icon":272},"Examples","\u002Fexamples","4.examples\u002F0.index",[271,273,278,283,288,293,297,302,307,312,317,322,327,331,336,340,344,349,354,359,364,369,374,379,383,388,393,398,402,407,412,416,421,426],{"title":267,"path":268,"stem":269,"icon":272},"i-lucide-folder-code",{"title":274,"path":275,"stem":276,"icon":277},"API Routes","\u002Fexamples\u002Fapi-routes","4.examples\u002Fapi-routes","i-lucide-route",{"title":279,"path":280,"stem":281,"icon":282},"Auto Imports","\u002Fexamples\u002Fauto-imports","4.examples\u002Fauto-imports","i-lucide-import",{"title":284,"path":285,"stem":286,"icon":287},"Cached Handler","\u002Fexamples\u002Fcached-handler","4.examples\u002Fcached-handler","i-lucide-clock",{"title":289,"path":290,"stem":291,"icon":292},"Custom Error Handler","\u002Fexamples\u002Fcustom-error-handler","4.examples\u002Fcustom-error-handler","i-lucide-alert-circle",{"title":38,"path":294,"stem":295,"icon":296},"\u002Fexamples\u002Fdatabase","4.examples\u002Fdatabase","i-lucide-database",{"title":298,"path":299,"stem":300,"icon":301},"Elysia","\u002Fexamples\u002Felysia","4.examples\u002Felysia","i-skill-icons-elysia-dark",{"title":303,"path":304,"stem":305,"icon":306},"Express","\u002Fexamples\u002Fexpress","4.examples\u002Fexpress","i-simple-icons-express",{"title":308,"path":309,"stem":310,"icon":311},"Fastify","\u002Fexamples\u002Ffastify","4.examples\u002Ffastify","i-simple-icons-fastify",{"title":313,"path":314,"stem":315,"icon":316},"Hello World","\u002Fexamples\u002Fhello-world","4.examples\u002Fhello-world","i-lucide-sparkles",{"title":318,"path":319,"stem":320,"icon":321},"Hono","\u002Fexamples\u002Fhono","4.examples\u002Fhono","i-logos-hono",{"title":323,"path":324,"stem":325,"icon":326},"Import Alias","\u002Fexamples\u002Fimport-alias","4.examples\u002Fimport-alias","i-lucide-at-sign",{"title":328,"path":329,"stem":330,"icon":46},"Middleware","\u002Fexamples\u002Fmiddleware","4.examples\u002Fmiddleware",{"title":332,"path":333,"stem":334,"icon":335},"Mono JSX","\u002Fexamples\u002Fmono-jsx","4.examples\u002Fmono-jsx","i-lucide-brackets",{"title":337,"path":338,"stem":339,"icon":335},"Nano JSX","\u002Fexamples\u002Fnano-jsx","4.examples\u002Fnano-jsx",{"title":53,"path":341,"stem":342,"icon":343},"\u002Fexamples\u002Fplugins","4.examples\u002Fplugins","i-lucide-plug",{"title":345,"path":346,"stem":347,"icon":348},"Custom Renderer","\u002Fexamples\u002Frenderer","4.examples\u002Frenderer","i-lucide-code",{"title":350,"path":351,"stem":352,"icon":353},"Runtime Config","\u002Fexamples\u002Fruntime-config","4.examples\u002Fruntime-config","i-lucide-settings",{"title":355,"path":356,"stem":357,"icon":358},"Server Fetch","\u002Fexamples\u002Fserver-fetch","4.examples\u002Fserver-fetch","i-lucide-arrow-right-left",{"title":360,"path":361,"stem":362,"icon":363},"Shiki","\u002Fexamples\u002Fshiki","4.examples\u002Fshiki","i-lucide-highlighter",{"title":365,"path":366,"stem":367,"icon":368},"Takumi","\u002Fexamples\u002Ftakumi","4.examples\u002Ftakumi","i-lucide-image",{"title":370,"path":371,"stem":372,"icon":373},"Tracing","\u002Fexamples\u002Ftracing","4.examples\u002Ftracing","i-lucide-activity",{"title":375,"path":376,"stem":377,"icon":378},"Virtual Routes","\u002Fexamples\u002Fvirtual-routes","4.examples\u002Fvirtual-routes","i-lucide-box",{"title":380,"path":381,"stem":382,"icon":91},"Vite Nitro Plugin","\u002Fexamples\u002Fvite-nitro-plugin","4.examples\u002Fvite-nitro-plugin",{"title":384,"path":385,"stem":386,"icon":387},"Vite RSC","\u002Fexamples\u002Fvite-rsc","4.examples\u002Fvite-rsc","i-logos-react",{"title":389,"path":390,"stem":391,"icon":392},"Vite SSR HTML","\u002Fexamples\u002Fvite-ssr-html","4.examples\u002Fvite-ssr-html","i-logos-html-5",{"title":394,"path":395,"stem":396,"icon":397},"SSR with Preact","\u002Fexamples\u002Fvite-ssr-preact","4.examples\u002Fvite-ssr-preact","i-logos-preact",{"title":399,"path":400,"stem":401,"icon":387},"SSR with React","\u002Fexamples\u002Fvite-ssr-react","4.examples\u002Fvite-ssr-react",{"title":403,"path":404,"stem":405,"icon":406},"SSR with SolidJS","\u002Fexamples\u002Fvite-ssr-solid","4.examples\u002Fvite-ssr-solid","i-logos-solidjs-icon",{"title":408,"path":409,"stem":410,"icon":411},"SSR with TanStack Router","\u002Fexamples\u002Fvite-ssr-tsr-react","4.examples\u002Fvite-ssr-tsr-react","i-simple-icons-tanstack",{"title":413,"path":414,"stem":415,"icon":411},"SSR with TanStack Start","\u002Fexamples\u002Fvite-ssr-tss-react","4.examples\u002Fvite-ssr-tss-react",{"title":417,"path":418,"stem":419,"icon":420},"SSR with Vue Router","\u002Fexamples\u002Fvite-ssr-vue-router","4.examples\u002Fvite-ssr-vue-router","i-logos-vue",{"title":422,"path":423,"stem":424,"icon":425},"Vite + tRPC","\u002Fexamples\u002Fvite-trpc","4.examples\u002Fvite-trpc","i-simple-icons-trpc",{"title":68,"path":427,"stem":428,"icon":429},"\u002Fexamples\u002Fwebsocket","4.examples\u002Fwebsocket","i-lucide-radio",{"title":431,"path":432,"stem":433,"children":434},"Blog","\u002Fblog","9.blog",[435,438],{"title":431,"path":432,"stem":436,"icon":437},"9.blog\u002Findex","i-lucide-file-text",{"title":439,"path":440,"stem":441,"icon":437},"Nitro v3 Beta is here!","\u002Fblog\u002Fv3-beta","9.blog\u002F1.v3-beta",{"title":5,"path":443,"stem":444},"\u002F","index",{"id":446,"title":113,"body":447,"description":2269,"extension":2270,"meta":2271,"navigation":2272,"path":114,"seo":2273,"stem":115,"__hash__":2274},"content\u002F1.docs\u002F99.migration.md",{"type":448,"value":449,"toc":2242,"icon":116},"minimark",[450,457,460,545,554,568,584,668,674,684,699,703,711,720,724,741,745,770,775,901,911,915,921,931,946,950,953,987,993,997,1015,1019,1042,1045,1073,1081,1140,1151,1155,1165,1168,1172,1179,1183,1221,1239,1254,1258,1264,1279,1380,1384,1407,1459,1462,1473,1498,1502,1513,1575,1579,1589,1613,1616,1627,1632,1664,1684,1688,1699,1744,1747,1778,1782,1788,1823,1825,1848,1883,1887,1902,1920,1924,1949,1953,1968,1972,1975,1978,2151,2196,2200,2206,2209,2213,2238],[451,452,453],"note",{},[454,455,456],"p",{},"\nThis is a living document for migrating from Nitro 2 to 3. Please check it regularly while using the beta version.",[454,458,459],{},"Most migrations follow the same order:",[461,462,464,486,503,515,526,534],"steps",{"level":463},"4",[465,466,467,480,481,485],"h4",{},[468,469,471,472,476,477],"a",{"href":470},"#nitropack-is-renamed-to-nitro","Rename the ",[473,474,475],"code",{},"nitropack"," dependency to ",[473,478,479],{},"nitro"," and upgrade to ",[468,482,484],{"href":483},"#minimum-supported-nodejs-version-20","Node.js 20+",".",[465,487,488,492,493,497,498,502],{},[468,489,491],{"href":490},"#auto-imports-are-disabled-by-default","Add explicit imports"," and update ",[468,494,496],{"href":495},"#type-imports","type"," and ",[468,499,501],{"href":500},"#changed-nitro-subpath-imports","subpath"," imports.",[465,504,505,506,510,511,485],{},"Update your config: ",[468,507,509],{"href":508},"#server-directory-scanning-is-opt-in","enable server directory scanning"," and review ",[468,512,514],{"href":513},"#app-config-support-removed","removed features",[465,516,517,518,497,522,485],{},"Review ",[468,519,521],{"href":520},"#route-rules","route rules",[468,523,525],{"href":524},"#runtime-utilities","runtime utilities",[465,527,528,529,533],{},"Update handlers for ",[468,530,532],{"href":531},"#h3-v2","H3 v2"," API changes.",[465,535,536,537,497,541,485],{},"Check your ",[468,538,540],{"href":539},"#preset-updates","deployment preset",[468,542,544],{"href":543},"#cloudflare-bindings-access","platform-specific access",[546,547,549,551,552],"h2",{"id":548},"nitropack-is-renamed-to-nitro",[473,550,475],{}," Is Renamed to ",[473,553,479],{},[454,555,556,557,562,563,567],{},"The NPM package ",[468,558,475],{"href":559,"rel":560},"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fnitropack",[561],"nofollow"," (v2) has been renamed to ",[468,564,479],{"href":565,"rel":566},"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fnitro",[561]," (v3).",[454,569,570,574,575,476,577,579,580,583],{},[571,572,573],"strong",{},"Migration:"," Update the ",[473,576,475],{},[473,578,479],{}," in ",[473,581,582],{},"package.json",":",[585,586,587,637],"code-group",{},[588,589,594],"pre",{"className":590,"code":591,"filename":592,"language":593,"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",[473,595,596,605,611,618,625,631],{"__ignoreMap":5},[597,598,601],"span",{"class":599,"line":600},"line",1,[597,602,604],{"class":603},"slsVL","{\n",[597,606,608],{"class":599,"line":607},2,[597,609,610],{"class":603},"  \"dependencies\": {\n",[597,612,614],{"class":599,"line":613},3,[597,615,617],{"class":616},"sLpD_","--    \"nitropack\": \"latest\"\n",[597,619,621],{"class":599,"line":620},4,[597,622,624],{"class":623},"sByVh","++    \"nitro\": \"latest\"\n",[597,626,628],{"class":599,"line":627},5,[597,629,630],{"class":603},"  }\n",[597,632,634],{"class":599,"line":633},6,[597,635,636],{"class":603},"}\n",[588,638,641],{"className":590,"code":639,"filename":640,"language":593,"meta":5,"style":5},"{\n  \"dependencies\": {\n--    \"nitropack\": \"latest\"\n++    \"nitro\": \"npm:nitro-nightly@latest\"\n  }\n}\n","nightly channel",[473,642,643,647,651,655,660,664],{"__ignoreMap":5},[597,644,645],{"class":599,"line":600},[597,646,604],{"class":603},[597,648,649],{"class":599,"line":607},[597,650,610],{"class":603},[597,652,653],{"class":599,"line":613},[597,654,617],{"class":616},[597,656,657],{"class":599,"line":620},[597,658,659],{"class":623},"++    \"nitro\": \"npm:nitro-nightly@latest\"\n",[597,661,662],{"class":599,"line":627},[597,663,630],{"class":603},[597,665,666],{"class":599,"line":633},[597,667,636],{"class":603},[454,669,670,671,673],{},"See the ",[468,672,640],{"href":119}," guide for more about nightly builds.",[454,675,676,678,679,681,682,583],{},[571,677,573],{}," Search your codebase and rename all instances of ",[473,680,475],{}," to ",[473,683,479],{},[588,685,687],{"className":590,"code":686,"language":593,"meta":5,"style":5},"-- import { defineNitroConfig } from \"nitropack\u002Fconfig\"\n++ import { defineConfig } from \"nitro\"\n",[473,688,689,694],{"__ignoreMap":5},[597,690,691],{"class":599,"line":600},[597,692,693],{"class":616},"-- import { defineNitroConfig } from \"nitropack\u002Fconfig\"\n",[597,695,696],{"class":599,"line":607},[597,697,698],{"class":623},"++ import { defineConfig } from \"nitro\"\n",[546,700,702],{"id":701},"minimum-supported-nodejs-version-20","Minimum Supported Node.js Version: 20",[454,704,705,706,485],{},"Nitro now requires a minimum Node.js version of 20, as Node.js 18 reached end-of-life in ",[468,707,710],{"href":708,"rel":709},"https:\u002F\u002Fnodejs.org\u002Fen\u002Fabout\u002Fprevious-releases",[561],"April 2025",[454,712,713,714,719],{},"Please upgrade to the ",[468,715,718],{"href":716,"rel":717},"https:\u002F\u002Fnodejs.org\u002Fen\u002Fdownload",[561],"latest LTS"," version (>= 20).",[454,721,722],{},[571,723,573],{},[725,726,727,735,738],"ul",{},[728,729,730,731,734],"li",{},"Check your local Node.js version using ",[473,732,733],{},"node --version"," and update if necessary.",[728,736,737],{},"If you use a CI\u002FCD system for deployment, ensure that your pipeline is running Node.js 20 or higher.",[728,739,740],{},"If your hosting provider manages the Node.js runtime, make sure it's set to version 20, 22, or later.",[546,742,744],{"id":743},"auto-imports-are-disabled-by-default","Auto-Imports Are Disabled by Default",[454,746,747,748,751,752,751,755,751,758,761,762,765,766,769],{},"Nitro v2 automatically made utilities such as ",[473,749,750],{},"defineEventHandler",", ",[473,753,754],{},"useStorage",[473,756,757],{},"useRuntimeConfig",[473,759,760],{},"defineCachedFunction",", and ",[473,763,764],{},"defineNitroPlugin"," available in server code without imports. In Nitro v3, auto-imports are ",[571,767,768],{},"disabled by default"," — using these globals will result in build or runtime errors.",[454,771,772,774],{},[571,773,573],{}," Add explicit imports everywhere. Common utilities and where they come from:",[588,776,780],{"className":777,"code":778,"language":779,"meta":5,"style":5},"language-ts shiki shiki-themes github-light github-dark github-dark","import { defineHandler, definePlugin, defineErrorHandler, HTTPError } from \"nitro\";\nimport { useStorage } from \"nitro\u002Fstorage\";\nimport { useRuntimeConfig } from \"nitro\u002Fruntime-config\";\nimport { defineCachedFunction, defineCachedHandler } from \"nitro\u002Fcache\";\nimport { useDatabase } from \"nitro\u002Fdatabase\";\nimport { defineTask, runTask } from \"nitro\u002Ftask\";\nimport { useNitroApp, useNitroHooks } from \"nitro\u002Fapp\";\nimport { getQuery, getCookie } from \"nitro\u002Fh3\";\n","ts",[473,781,782,801,815,829,843,857,871,886],{"__ignoreMap":5},[597,783,784,788,791,794,798],{"class":599,"line":600},[597,785,787],{"class":786},"so5gQ","import",[597,789,790],{"class":603}," { defineHandler, definePlugin, defineErrorHandler, HTTPError } ",[597,792,793],{"class":786},"from",[597,795,797],{"class":796},"sfrk1"," \"nitro\"",[597,799,800],{"class":603},";\n",[597,802,803,805,808,810,813],{"class":599,"line":607},[597,804,787],{"class":786},[597,806,807],{"class":603}," { useStorage } ",[597,809,793],{"class":786},[597,811,812],{"class":796}," \"nitro\u002Fstorage\"",[597,814,800],{"class":603},[597,816,817,819,822,824,827],{"class":599,"line":613},[597,818,787],{"class":786},[597,820,821],{"class":603}," { useRuntimeConfig } ",[597,823,793],{"class":786},[597,825,826],{"class":796}," \"nitro\u002Fruntime-config\"",[597,828,800],{"class":603},[597,830,831,833,836,838,841],{"class":599,"line":620},[597,832,787],{"class":786},[597,834,835],{"class":603}," { defineCachedFunction, defineCachedHandler } ",[597,837,793],{"class":786},[597,839,840],{"class":796}," \"nitro\u002Fcache\"",[597,842,800],{"class":603},[597,844,845,847,850,852,855],{"class":599,"line":627},[597,846,787],{"class":786},[597,848,849],{"class":603}," { useDatabase } ",[597,851,793],{"class":786},[597,853,854],{"class":796}," \"nitro\u002Fdatabase\"",[597,856,800],{"class":603},[597,858,859,861,864,866,869],{"class":599,"line":633},[597,860,787],{"class":786},[597,862,863],{"class":603}," { defineTask, runTask } ",[597,865,793],{"class":786},[597,867,868],{"class":796}," \"nitro\u002Ftask\"",[597,870,800],{"class":603},[597,872,874,876,879,881,884],{"class":599,"line":873},7,[597,875,787],{"class":786},[597,877,878],{"class":603}," { useNitroApp, useNitroHooks } ",[597,880,793],{"class":786},[597,882,883],{"class":796}," \"nitro\u002Fapp\"",[597,885,800],{"class":603},[597,887,889,891,894,896,899],{"class":599,"line":888},8,[597,890,787],{"class":786},[597,892,893],{"class":603}," { getQuery, getCookie } ",[597,895,793],{"class":786},[597,897,898],{"class":796}," \"nitro\u002Fh3\"",[597,900,800],{"class":603},[902,903,904],"tip",{},[454,905,906,907,910],{},"You can opt back into auto-imports by setting the ",[473,908,909],{},"imports"," option in your Nitro config, but explicit imports are recommended for better ecosystem compatibility.",[546,912,914],{"id":913},"type-imports","Type Imports",[454,916,917,918,485],{},"Nitro types are now only exported from ",[473,919,920],{},"nitro\u002Ftypes",[454,922,923,925,926,928,929,583],{},[571,924,573],{}," Import types from ",[473,927,920],{}," instead of ",[473,930,479],{},[588,932,934],{"className":590,"code":933,"language":593,"meta":5,"style":5},"-- import { NitroRuntimeConfig } from \"nitropack\"\n++ import { NitroRuntimeConfig } from \"nitro\u002Ftypes\"\n",[473,935,936,941],{"__ignoreMap":5},[597,937,938],{"class":599,"line":600},[597,939,940],{"class":616},"-- import { NitroRuntimeConfig } from \"nitropack\"\n",[597,942,943],{"class":599,"line":607},[597,944,945],{"class":623},"++ import { NitroRuntimeConfig } from \"nitro\u002Ftypes\"\n",[546,947,949],{"id":948},"changed-nitro-subpath-imports","Changed Nitro Subpath Imports",[454,951,952],{},"Nitro v2 introduced multiple subpath exports, some of which have been removed or updated:",[725,954,955,968,976,982],{},[728,956,957,751,960,963,964,967],{},[473,958,959],{},"nitropack\u002Frollup",[473,961,962],{},"nitropack\u002Fcore"," (use ",[473,965,966],{},"nitro\u002Fbuilder",")",[728,969,970,963,973,967],{},[473,971,972],{},"nitropack\u002Fruntime\u002F*",[473,974,975],{},"nitro\u002F*",[728,977,978,981],{},[473,979,980],{},"nitropack\u002Fkit"," (removed)",[728,983,984,981],{},[473,985,986],{},"nitropack\u002Fpresets",[454,988,989,990,992],{},"An experimental ",[473,991,980],{}," was introduced but has now been removed. A standalone Nitro Kit package may be introduced in the future with clearer objectives.",[454,994,995],{},[571,996,573],{},[725,998,999,1012],{},[728,1000,1001,1002,1005,1006,928,1008,1011],{},"Use ",[473,1003,1004],{},"NitroModule"," from ",[473,1007,920],{},[473,1009,1010],{},"defineNitroModule"," from the kit.",[728,1013,1014],{},"Prefer built-in Nitro presets (external presets are only for evaluation purposes).",[546,1016,1018],{"id":1017},"server-directory-scanning-is-opt-in","Server Directory Scanning Is Opt-In",[454,1020,1021,1022,1025,1026,751,1029,751,1032,751,1035,761,1038,1041],{},"In Nitro v2, ",[473,1023,1024],{},"srcDir"," defaulted to the project root, and directories such as ",[473,1027,1028],{},"routes\u002F",[473,1030,1031],{},"api\u002F",[473,1033,1034],{},"middleware\u002F",[473,1036,1037],{},"plugins\u002F",[473,1039,1040],{},"tasks\u002F"," were always scanned.",[454,1043,1044],{},"In Nitro v3:",[725,1046,1047,1060],{},[728,1048,1049,1050,1052,1053,1056,1057,1059],{},"The ",[473,1051,1024],{}," option is deprecated in favor of ",[473,1054,1055],{},"serverDir"," (using ",[473,1058,1024],{}," still works but logs a warning).",[728,1061,1062,1064,1065,1068,1069,1072],{},[473,1063,1055],{}," defaults to ",[473,1066,1067],{},"false",", meaning ",[571,1070,1071],{},"no directory scanning happens"," until you explicitly enable it — scanned routes, middleware, plugins, and tasks won't be registered otherwise.",[454,1074,1075,1077,1078,1080],{},[571,1076,573],{}," Set ",[473,1079,1055],{}," in your Nitro config:",[588,1082,1085],{"className":777,"code":1083,"filename":1084,"language":779,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  serverDir: \".\u002Fserver\", \u002F\u002F or \".\" to keep the v2 root layout\n});\n","nitro.config.ts",[473,1086,1087,1100,1106,1121,1135],{"__ignoreMap":5},[597,1088,1089,1091,1094,1096,1098],{"class":599,"line":600},[597,1090,787],{"class":786},[597,1092,1093],{"class":603}," { defineConfig } ",[597,1095,793],{"class":786},[597,1097,797],{"class":796},[597,1099,800],{"class":603},[597,1101,1102],{"class":599,"line":607},[597,1103,1105],{"emptyLinePlaceholder":1104},true,"\n",[597,1107,1108,1111,1114,1118],{"class":599,"line":613},[597,1109,1110],{"class":786},"export",[597,1112,1113],{"class":786}," default",[597,1115,1117],{"class":1116},"shcOC"," defineConfig",[597,1119,1120],{"class":603},"({\n",[597,1122,1123,1126,1129,1131],{"class":599,"line":620},[597,1124,1125],{"class":603},"  serverDir: ",[597,1127,1128],{"class":796},"\".\u002Fserver\"",[597,1130,751],{"class":603},[597,1132,1134],{"class":1133},"sCsY4","\u002F\u002F or \".\" to keep the v2 root layout\n",[597,1136,1137],{"class":599,"line":627},[597,1138,1139],{"class":603},"});\n",[454,1141,1142,1143,1146,1147,1150],{},"Setting ",[473,1144,1145],{},"serverDir: true"," is a shortcut for ",[473,1148,1149],{},"\"server\"",". Paths are resolved relative to the project root.",[546,1152,1154],{"id":1153},"app-config-support-removed","App Config Support Removed",[454,1156,1157,1158,1161,1162,485],{},"Nitro v2 supported a bundled app config that allowed defining configurations in ",[473,1159,1160],{},"app.config.ts"," and accessing them at runtime via ",[473,1163,1164],{},"useAppConfig()",[454,1166,1167],{},"This feature has been removed.",[454,1169,1170],{},[571,1171,573],{},[454,1173,1174,1175,1178],{},"Use a regular ",[473,1176,1177],{},".ts"," file in your server directory and import it directly.",[546,1180,1182],{"id":1181},"route-rules","Route Rules",[454,1184,1185,1186,1191,1192,751,1195,751,1198,751,1201,751,1204,761,1207,1210,1211,751,1214,761,1217,1220],{},"Route rule matching and handling moved to ",[468,1187,1190],{"href":1188,"rel":1189},"https:\u002F\u002Fgithub.com\u002Fh3js\u002Fh3-rules",[561],"h3-rules",". The rule shapes for ",[473,1193,1194],{},"redirect",[473,1196,1197],{},"proxy",[473,1199,1200],{},"cors",[473,1202,1203],{},"headers",[473,1205,1206],{},"cache",[473,1208,1209],{},"swr"," are now defined by h3-rules, while ",[473,1212,1213],{},"isr",[473,1215,1216],{},"prerender",[473,1218,1219],{},"static"," remain Nitro-specific rules.",[454,1222,1049,1223,497,1226,1229,1230,497,1233,1236,1237,583],{},[473,1224,1225],{},"NitroRouteConfig",[473,1227,1228],{},"NitroRouteRules"," types are deprecated in favor of ",[473,1231,1232],{},"RouteRuleConfig",[473,1234,1235],{},"RouteRules",", re-exported from ",[473,1238,920],{},[588,1240,1242],{"className":590,"code":1241,"language":593,"meta":5,"style":5},"-- import { NitroRouteConfig, NitroRouteRules } from \"nitropack\u002Ftypes\"\n++ import { RouteRuleConfig, RouteRules } from \"nitro\u002Ftypes\"\n",[473,1243,1244,1249],{"__ignoreMap":5},[597,1245,1246],{"class":599,"line":600},[597,1247,1248],{"class":616},"-- import { NitroRouteConfig, NitroRouteRules } from \"nitropack\u002Ftypes\"\n",[597,1250,1251],{"class":599,"line":607},[597,1252,1253],{"class":623},"++ import { RouteRuleConfig, RouteRules } from \"nitro\u002Ftypes\"\n",[546,1255,1257],{"id":1256},"runtime-utilities","Runtime Utilities",[454,1259,1260,1261,1263],{},"Runtime utilities have been moved to individual ",[473,1262,975],{}," subpath exports. Refer to docs for usage.",[588,1265,1267],{"className":590,"code":1266,"language":593,"meta":5,"style":5},"-- import { useStorage } from \"nitropack\u002Fruntime\u002Fstorage\"\n++ import { useStorage } from \"nitro\u002Fstorage\"\n",[473,1268,1269,1274],{"__ignoreMap":5},[597,1270,1271],{"class":599,"line":600},[597,1272,1273],{"class":616},"-- import { useStorage } from \"nitropack\u002Fruntime\u002Fstorage\"\n",[597,1275,1276],{"class":599,"line":607},[597,1277,1278],{"class":623},"++ import { useStorage } from \"nitro\u002Fstorage\"\n",[1280,1281,1282,1295],"table",{},[1283,1284,1285],"thead",{},[1286,1287,1288,1292],"tr",{},[1289,1290,1291],"th",{},"Utilities",[1289,1293,1294],{},"Nitro v3 Import",[1296,1297,1298,1310,1324,1336,1347,1362],"tbody",{},[1286,1299,1300,1305],{},[1301,1302,1303],"td",{},[473,1304,754],{},[1301,1306,1307],{},[473,1308,1309],{},"nitro\u002Fstorage",[1286,1311,1312,1319],{},[1301,1313,1314,751,1316],{},[473,1315,760],{},[473,1317,1318],{},"defineCachedHandler",[1301,1320,1321],{},[473,1322,1323],{},"nitro\u002Fcache",[1286,1325,1326,1331],{},[1301,1327,1328],{},[473,1329,1330],{},"useDatabase",[1301,1332,1333],{},[473,1334,1335],{},"nitro\u002Fdatabase",[1286,1337,1338,1342],{},[1301,1339,1340],{},[473,1341,757],{},[1301,1343,1344],{},[473,1345,1346],{},"nitro\u002Fruntime-config",[1286,1348,1349,1357],{},[1301,1350,1351,751,1354],{},[473,1352,1353],{},"defineTask",[473,1355,1356],{},"runTask",[1301,1358,1359],{},[473,1360,1361],{},"nitro\u002Ftask",[1286,1363,1364,1375],{},[1301,1365,1366,751,1369,751,1372],{},[473,1367,1368],{},"useNitroApp",[473,1370,1371],{},"useNitroHooks",[473,1373,1374],{},"getRouteRules",[1301,1376,1377],{},[473,1378,1379],{},"nitro\u002Fapp",[546,1381,1383],{"id":1382},"internal-server-fetch","Internal Server Fetch",[454,1385,1386,1387,1390,1391,1394,1395,1397,1398,1401,1402,1404,1405,485],{},"To make internal requests to your own server (the v2 ",[473,1388,1389],{},"useNitroApp().localFetch"," pattern), use the ",[473,1392,1393],{},"serverFetch"," utility exported from ",[473,1396,479],{},". There is also a ",[473,1399,1400],{},"fetch"," export that routes absolute paths (starting with ",[473,1403,443],{},") to the server and everything else to global ",[473,1406,1400],{},[588,1408,1410],{"className":777,"code":1409,"language":779,"meta":5,"style":5},"import { serverFetch } from \"nitro\";\n\nconst res = await serverFetch(\"\u002Fapi\u002Fhello\"); \u002F\u002F returns a web Response\n",[473,1411,1412,1425,1429],{"__ignoreMap":5},[597,1413,1414,1416,1419,1421,1423],{"class":599,"line":600},[597,1415,787],{"class":786},[597,1417,1418],{"class":603}," { serverFetch } ",[597,1420,793],{"class":786},[597,1422,797],{"class":796},[597,1424,800],{"class":603},[597,1426,1427],{"class":599,"line":607},[597,1428,1105],{"emptyLinePlaceholder":1104},[597,1430,1431,1434,1438,1441,1444,1447,1450,1453,1456],{"class":599,"line":613},[597,1432,1433],{"class":786},"const",[597,1435,1437],{"class":1436},"suiK_"," res",[597,1439,1440],{"class":786}," =",[597,1442,1443],{"class":786}," await",[597,1445,1446],{"class":1116}," serverFetch",[597,1448,1449],{"class":603},"(",[597,1451,1452],{"class":796},"\"\u002Fapi\u002Fhello\"",[597,1454,1455],{"class":603},"); ",[597,1457,1458],{"class":1133},"\u002F\u002F returns a web Response\n",[546,1460,53],{"id":1461},"plugins",[454,1463,1049,1464,1466,1467,1470,1471,485],{},[473,1465,764],{}," utility has been renamed to ",[473,1468,1469],{},"definePlugin"," and is now imported from ",[473,1472,479],{},[588,1474,1476],{"className":590,"code":1475,"language":593,"meta":5,"style":5},"-- export default defineNitroPlugin((nitroApp) => {\n++ import { definePlugin } from \"nitro\"\n++\n++ export default definePlugin((nitroApp) => {\n",[473,1477,1478,1483,1488,1493],{"__ignoreMap":5},[597,1479,1480],{"class":599,"line":600},[597,1481,1482],{"class":616},"-- export default defineNitroPlugin((nitroApp) => {\n",[597,1484,1485],{"class":599,"line":607},[597,1486,1487],{"class":623},"++ import { definePlugin } from \"nitro\"\n",[597,1489,1490],{"class":599,"line":613},[597,1491,1492],{"class":623},"++\n",[597,1494,1495],{"class":599,"line":620},[597,1496,1497],{"class":623},"++ export default definePlugin((nitroApp) => {\n",[546,1499,1501],{"id":1500},"optional-hooks","Optional Hooks",[454,1503,1504,1505,1508,1509,1512],{},"If you were using ",[473,1506,1507],{},"useNitroApp().hooks"," outside of Nitro plugins before, it might be undefined. Use new ",[473,1510,1511],{},"useNitroHooks()"," to guarantee having an instance.",[588,1514,1516],{"className":777,"code":1515,"language":779,"meta":5,"style":5},"import { useNitroHooks } from \"nitro\u002Fapp\";\n\nuseNitroHooks().hook(\"request\", (event) => {\n  \u002F* ... *\u002F\n});\n",[473,1517,1518,1531,1535,1566,1571],{"__ignoreMap":5},[597,1519,1520,1522,1525,1527,1529],{"class":599,"line":600},[597,1521,787],{"class":786},[597,1523,1524],{"class":603}," { useNitroHooks } ",[597,1526,793],{"class":786},[597,1528,883],{"class":796},[597,1530,800],{"class":603},[597,1532,1533],{"class":599,"line":607},[597,1534,1105],{"emptyLinePlaceholder":1104},[597,1536,1537,1539,1542,1545,1547,1550,1553,1557,1560,1563],{"class":599,"line":613},[597,1538,1371],{"class":1116},[597,1540,1541],{"class":603},"().",[597,1543,1544],{"class":1116},"hook",[597,1546,1449],{"class":603},[597,1548,1549],{"class":796},"\"request\"",[597,1551,1552],{"class":603},", (",[597,1554,1556],{"class":1555},"sQHwn","event",[597,1558,1559],{"class":603},") ",[597,1561,1562],{"class":786},"=>",[597,1564,1565],{"class":603}," {\n",[597,1567,1568],{"class":599,"line":620},[597,1569,1570],{"class":1133},"  \u002F* ... *\u002F\n",[597,1572,1573],{"class":599,"line":627},[597,1574,1139],{"class":603},[546,1576,1578],{"id":1577},"error-handler","Error Handler",[454,1580,1049,1581,1466,1584,1470,1587,485],{},[473,1582,1583],{},"defineNitroErrorHandler",[473,1585,1586],{},"defineErrorHandler",[473,1588,479],{},[588,1590,1592],{"className":590,"code":1591,"language":593,"meta":5,"style":5},"-- export default defineNitroErrorHandler((error, event) => {\n++ import { defineErrorHandler } from \"nitro\"\n++\n++ export default defineErrorHandler((error, event) => {\n",[473,1593,1594,1599,1604,1608],{"__ignoreMap":5},[597,1595,1596],{"class":599,"line":600},[597,1597,1598],{"class":616},"-- export default defineNitroErrorHandler((error, event) => {\n",[597,1600,1601],{"class":599,"line":607},[597,1602,1603],{"class":623},"++ import { defineErrorHandler } from \"nitro\"\n",[597,1605,1606],{"class":599,"line":613},[597,1607,1492],{"class":623},[597,1609,1610],{"class":599,"line":620},[597,1611,1612],{"class":623},"++ export default defineErrorHandler((error, event) => {\n",[546,1614,532],{"id":1615},"h3-v2",[454,1617,1618,1619,1623,1624,485],{},"Nitro v3 upgrades to ",[468,1620,532],{"href":1621,"rel":1622},"https:\u002F\u002Fh3.dev",[561],", which includes API changes. All H3 utilities are imported from ",[473,1625,1626],{},"nitro\u002Fh3",[1628,1629,1631],"h3",{"id":1630},"web-standards","Web Standards",[454,1633,1634,1635,751,1642,751,1649,761,1656,1663],{},"H3 v2 is rewritten based on web standard primitives (",[468,1636,1639],{"href":1637,"rel":1638},"https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FURL",[561],[473,1640,1641],{},"URL",[468,1643,1646],{"href":1644,"rel":1645},"https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FHeaders",[561],[473,1647,1648],{},"Headers",[468,1650,1653],{"href":1651,"rel":1652},"https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FRequest",[561],[473,1654,1655],{},"Request",[468,1657,1660],{"href":1658,"rel":1659},"https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FResponse",[561],[473,1661,1662],{},"Response",").",[454,1665,1666,1667,1670,1671,1674,1675,1678,1679,1663],{},"Access to ",[473,1668,1669],{},"event.node.{req,res}"," is only available in Node.js runtime. ",[473,1672,1673],{},"event.web"," is renamed to ",[473,1676,1677],{},"event.req"," (instance of web ",[468,1680,1682],{"href":1651,"rel":1681},[561],[473,1683,1655],{},[1628,1685,1687],{"id":1686},"response-handling","Response Handling",[454,1689,1690,1691,1694,1695,1698],{},"You should always explicitly ",[571,1692,1693],{},"return"," the response body or ",[571,1696,1697],{},"throw"," an error:",[588,1700,1702],{"className":590,"code":1701,"language":593,"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",[473,1703,1704,1709,1714,1719,1724,1729,1734,1739],{"__ignoreMap":5},[597,1705,1706],{"class":599,"line":600},[597,1707,1708],{"class":616},"-- import { send, sendRedirect, sendStream } from \"nitro\u002Fh3\"\n",[597,1710,1711],{"class":599,"line":607},[597,1712,1713],{"class":616},"-- send(event, value)\n",[597,1715,1716],{"class":599,"line":613},[597,1717,1718],{"class":616},"-- sendStream(event, stream)\n",[597,1720,1721],{"class":599,"line":620},[597,1722,1723],{"class":616},"-- sendRedirect(event, location, code)\n",[597,1725,1726],{"class":599,"line":627},[597,1727,1728],{"class":623},"++ import { redirect } from \"nitro\u002Fh3\"\n",[597,1730,1731],{"class":599,"line":633},[597,1732,1733],{"class":623},"++ return value\n",[597,1735,1736],{"class":599,"line":873},[597,1737,1738],{"class":623},"++ return stream\n",[597,1740,1741],{"class":599,"line":888},[597,1742,1743],{"class":623},"++ return redirect(event, location, code)\n",[454,1745,1746],{},"Other changes:",[725,1748,1749,1762,1770],{},[728,1750,1751,1754,1755,1758,1759,967],{},[473,1752,1753],{},"sendError(event, error)"," → ",[473,1756,1757],{},"throw error"," (or ",[473,1760,1761],{},"throw new HTTPError(...)",[728,1763,1764,1754,1767],{},[473,1765,1766],{},"sendNoContent(event)",[473,1768,1769],{},"return noContent(event)",[728,1771,1772,1754,1775],{},[473,1773,1774],{},"sendProxy(event, target)",[473,1776,1777],{},"return proxy(event, target)",[1628,1779,1781],{"id":1780},"request-body","Request Body",[454,1783,1784,1785,1787],{},"Most body utilities can be replaced with native ",[473,1786,1677],{}," methods:",[588,1789,1791],{"className":590,"code":1790,"language":593,"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",[473,1792,1793,1798,1803,1808,1813,1818],{"__ignoreMap":5},[597,1794,1795],{"class":599,"line":600},[597,1796,1797],{"class":616},"-- import { readBody, readRawBody, readFormData } from \"nitro\u002Fh3\"\n",[597,1799,1800],{"class":599,"line":607},[597,1801,1802],{"class":623},"++ \u002F\u002F Use native Request methods\n",[597,1804,1805],{"class":599,"line":613},[597,1806,1807],{"class":623},"++ const json = await event.req.json()\n",[597,1809,1810],{"class":599,"line":620},[597,1811,1812],{"class":623},"++ const text = await event.req.text()\n",[597,1814,1815],{"class":599,"line":627},[597,1816,1817],{"class":623},"++ const formData = await event.req.formData()\n",[597,1819,1820],{"class":599,"line":633},[597,1821,1822],{"class":623},"++ const stream = event.req.body\n",[1628,1824,1648],{"id":1203},[454,1826,1827,1828,1833,1834,1837,1838,751,1841,1844,1845,1663],{},"H3 now uses standard web ",[468,1829,1831],{"href":1644,"rel":1830},[561],[473,1832,1648],{},". Header values are always plain ",[473,1835,1836],{},"string"," (no ",[473,1839,1840],{},"null",[473,1842,1843],{},"undefined",", or ",[473,1846,1847],{},"string[]",[588,1849,1851],{"className":590,"code":1850,"language":593,"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",[473,1852,1853,1858,1863,1868,1873,1878],{"__ignoreMap":5},[597,1854,1855],{"class":599,"line":600},[597,1856,1857],{"class":616},"-- import { getHeader, setHeader, getResponseStatus } from \"nitro\u002Fh3\"\n",[597,1859,1860],{"class":599,"line":607},[597,1861,1862],{"class":616},"-- getHeader(event, \"x-foo\")\n",[597,1864,1865],{"class":599,"line":613},[597,1866,1867],{"class":616},"-- setHeader(event, \"x-foo\", \"bar\")\n",[597,1869,1870],{"class":599,"line":620},[597,1871,1872],{"class":623},"++ event.req.headers.get(\"x-foo\")\n",[597,1874,1875],{"class":599,"line":627},[597,1876,1877],{"class":623},"++ event.res.headers.set(\"x-foo\", \"bar\")\n",[597,1879,1880],{"class":599,"line":633},[597,1881,1882],{"class":623},"++ event.res.status \u002F\u002F instead of getResponseStatus(event)\n",[1628,1884,1886],{"id":1885},"handler-utils","Handler Utils",[588,1888,1890],{"className":590,"code":1889,"language":593,"meta":5,"style":5},"-- import { eventHandler, defineEventHandler } from \"nitro\u002Fh3\"\n++ import { defineHandler } from \"nitro\"\n",[473,1891,1892,1897],{"__ignoreMap":5},[597,1893,1894],{"class":599,"line":600},[597,1895,1896],{"class":616},"-- import { eventHandler, defineEventHandler } from \"nitro\u002Fh3\"\n",[597,1898,1899],{"class":599,"line":607},[597,1900,1901],{"class":623},"++ import { defineHandler } from \"nitro\"\n",[725,1903,1904,1912],{},[728,1905,1906,1754,1909],{},[473,1907,1908],{},"lazyEventHandler",[473,1910,1911],{},"defineLazyEventHandler",[728,1913,1914,1754,1917],{},[473,1915,1916],{},"useBase",[473,1918,1919],{},"withBase",[1628,1921,1923],{"id":1922},"error-utils","Error Utils",[588,1925,1927],{"className":590,"code":1926,"language":593,"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",[473,1928,1929,1934,1939,1944],{"__ignoreMap":5},[597,1930,1931],{"class":599,"line":600},[597,1932,1933],{"class":616},"-- import { createError, isError } from \"nitro\u002Fh3\"\n",[597,1935,1936],{"class":599,"line":607},[597,1937,1938],{"class":623},"++ import { HTTPError } from \"nitro\"\n",[597,1940,1941],{"class":599,"line":613},[597,1942,1943],{"class":623},"++ throw new HTTPError({ status: 404, message: \"Not found\" })\n",[597,1945,1946],{"class":599,"line":620},[597,1947,1948],{"class":623},"++ HTTPError.isError(error)\n",[1628,1950,1952],{"id":1951},"nodejs-utils","Node.js Utils",[588,1954,1956],{"className":590,"code":1955,"language":593,"meta":5,"style":5},"-- import { defineNodeListener, fromNodeMiddleware, toNodeListener } from \"nitro\u002Fh3\"\n++ import { defineNodeHandler, fromNodeHandler, toNodeHandler } from \"nitro\u002Fh3\"\n",[473,1957,1958,1963],{"__ignoreMap":5},[597,1959,1960],{"class":599,"line":600},[597,1961,1962],{"class":616},"-- import { defineNodeListener, fromNodeMiddleware, toNodeListener } from \"nitro\u002Fh3\"\n",[597,1964,1965],{"class":599,"line":607},[597,1966,1967],{"class":623},"++ import { defineNodeHandler, fromNodeHandler, toNodeHandler } from \"nitro\u002Fh3\"\n",[546,1969,1971],{"id":1970},"preset-updates","Preset Updates",[454,1973,1974],{},"Nitro presets have been updated for the latest compatibility.",[454,1976,1977],{},"Some (legacy) presets have been removed or renamed.",[1280,1979,1980,1990],{},[1283,1981,1982],{},[1286,1983,1984,1987],{},[1289,1985,1986],{},"Old Preset",[1289,1988,1989],{},"New Preset",[1296,1991,1992,2009,2027,2040,2056,2069,2084,2096,2108,2121,2131,2141],{},[1286,1993,1994,2000],{},[1301,1995,1996,1999],{},[473,1997,1998],{},"node"," (Node.js middleware)",[1301,2001,2002,2005,2006,967],{},[473,2003,2004],{},"node_middleware"," (export changed to ",[473,2007,2008],{},"middleware",[1286,2010,2011,2022],{},[1301,2012,2013,751,2016,751,2019],{},[473,2014,2015],{},"cloudflare",[473,2017,2018],{},"cloudflare_worker",[473,2020,2021],{},"cloudflare_module_legacy",[1301,2023,2024],{},[473,2025,2026],{},"cloudflare_module",[1286,2028,2029,2034],{},[1301,2030,2031],{},[473,2032,2033],{},"deno-server-legacy",[1301,2035,2036,2039],{},[473,2037,2038],{},"deno_server"," with Deno v2",[1286,2041,2042,2047],{},[1301,2043,2044],{},[473,2045,2046],{},"netlify-builder",[1301,2048,2049,2052,2053],{},[473,2050,2051],{},"netlify"," or ",[473,2054,2055],{},"netlify_edge",[1286,2057,2058,2063],{},[1301,2059,2060],{},[473,2061,2062],{},"vercel-edge",[1301,2064,2065,2068],{},[473,2066,2067],{},"vercel"," with Fluid compute enabled",[1286,2070,2071,2079],{},[1301,2072,2073,751,2076],{},[473,2074,2075],{},"azure",[473,2077,2078],{},"azure_functions",[1301,2080,2081],{},[473,2082,2083],{},"azure_swa",[1286,2085,2086,2091],{},[1301,2087,2088],{},[473,2089,2090],{},"firebase",[1301,2092,2093],{},[473,2094,2095],{},"firebase_app_hosting",[1286,2097,2098,2103],{},[1301,2099,2100],{},[473,2101,2102],{},"iis",[1301,2104,2105],{},[473,2106,2107],{},"iis_handler",[1286,2109,2110,2116],{},[1301,2111,2112,2115],{},[473,2113,2114],{},"deno"," (Deno Deploy)",[1301,2117,2118],{},[473,2119,2120],{},"deno_deploy",[1286,2122,2123,2128],{},[1301,2124,2125],{},[473,2126,2127],{},"edgio",[1301,2129,2130],{},"Discontinued",[1286,2132,2133,2138],{},[1301,2134,2135],{},[473,2136,2137],{},"cli",[1301,2139,2140],{},"Removed due to lack of use",[1286,2142,2143,2148],{},[1301,2144,2145],{},[473,2146,2147],{},"service_worker",[1301,2149,2150],{},"Removed due to instability",[2152,2153,2154,2161],"warning",{},[454,2155,1049,2156,497,2158,2160],{},[473,2157,1998],{},[473,2159,2114],{}," preset names still exist in v3, but they now point to different targets:",[725,2162,2163,2183],{},[728,2164,2165,2166,2168,2169,2171,2172,2175,2176,2179,2180,2182],{},"In v2, the ",[473,2167,1998],{}," preset produced a reusable Node.js middleware. In v3, ",[473,2170,1998],{}," is an alias of ",[473,2173,2174],{},"node_server",", which builds a full standalone Node.js server. If you keep ",[473,2177,2178],{},"preset: \"node\"",", you now get a standalone server — use ",[473,2181,2004],{}," to keep the v2 middleware output.",[728,2184,2165,2185,2187,2188,2171,2190,2192,2193,2195],{},[473,2186,2114],{}," preset targeted Deno Deploy. In v3, ",[473,2189,2114],{},[473,2191,2038],{},", which builds a self-hosted Deno server — use ",[473,2194,2120],{}," to keep deploying to Deno Deploy.",[546,2197,2199],{"id":2198},"cloudflare-bindings-access","Cloudflare Bindings Access",[454,2201,2202,2203,485],{},"In Nitro v2, Cloudflare environment variables and bindings were accessible via ",[473,2204,2205],{},"event.context.cloudflare.env",[454,2207,2208],{},"In Nitro v3, the Cloudflare runtime context is attached to the request's runtime object instead.",[454,2210,2211],{},[571,2212,573],{},[588,2214,2216],{"className":590,"code":2215,"language":593,"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",[473,2217,2218,2223,2228,2233],{"__ignoreMap":5},[597,2219,2220],{"class":599,"line":600},[597,2221,2222],{"class":616},"-- const { cloudflare } = event.context\n",[597,2224,2225],{"class":599,"line":607},[597,2226,2227],{"class":616},"-- const binding = cloudflare.env.MY_BINDING\n",[597,2229,2230],{"class":599,"line":613},[597,2231,2232],{"class":623},"++ const { env } = event.req.runtime.cloudflare\n",[597,2234,2235],{"class":599,"line":620},[597,2236,2237],{"class":623},"++ const binding = env.MY_BINDING\n",[2239,2240,2241],"style",{},"html pre.shiki code .so5gQ, html code.shiki .so5gQ{--shiki-light:#D73A49;--shiki-default:#F97583;--shiki-dark:#F97583}html pre.shiki code .slsVL, html code.shiki .slsVL{--shiki-light:#24292E;--shiki-default:#E1E4E8;--shiki-dark:#E1E4E8}html pre.shiki code .sfrk1, html code.shiki .sfrk1{--shiki-light:#032F62;--shiki-default:#9ECBFF;--shiki-dark:#9ECBFF}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);}html pre.shiki code .shcOC, html code.shiki .shcOC{--shiki-light:#6F42C1;--shiki-default:#B392F0;--shiki-dark:#B392F0}html pre.shiki code .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .suiK_, html code.shiki .suiK_{--shiki-light:#005CC5;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}html pre.shiki code .sQHwn, html code.shiki .sQHwn{--shiki-light:#E36209;--shiki-default:#FFAB70;--shiki-dark:#FFAB70}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}",{"title":5,"searchDepth":607,"depth":607,"links":2243},[2244,2246,2247,2248,2249,2250,2251,2252,2253,2254,2255,2256,2257,2258,2267,2268],{"id":548,"depth":607,"text":2245},"nitropack Is Renamed to nitro",{"id":701,"depth":607,"text":702},{"id":743,"depth":607,"text":744},{"id":913,"depth":607,"text":914},{"id":948,"depth":607,"text":949},{"id":1017,"depth":607,"text":1018},{"id":1153,"depth":607,"text":1154},{"id":1181,"depth":607,"text":1182},{"id":1256,"depth":607,"text":1257},{"id":1382,"depth":607,"text":1383},{"id":1461,"depth":607,"text":53},{"id":1500,"depth":607,"text":1501},{"id":1577,"depth":607,"text":1578},{"id":1615,"depth":607,"text":532,"children":2259},[2260,2261,2262,2263,2264,2265,2266],{"id":1630,"depth":613,"text":1631},{"id":1686,"depth":613,"text":1687},{"id":1780,"depth":613,"text":1781},{"id":1203,"depth":613,"text":1648},{"id":1885,"depth":613,"text":1886},{"id":1922,"depth":613,"text":1923},{"id":1951,"depth":613,"text":1952},{"id":1970,"depth":607,"text":1971},{"id":2198,"depth":607,"text":2199},"Nitro v3 introduces intentional backward-incompatible changes. This guide helps you migrate from Nitro v2.","md",{"icon":116},{"icon":116},{"title":113,"description":2269},"ldWq4bTeRuA2_IHJXsVu0-eN2M4uuaRl76qZgID4WpQ",[2276,2278],{"title":108,"path":109,"stem":110,"description":2277,"icon":111,"children":-1},"Nitro provides a built-in storage layer that can abstract the filesystem, a database, or any other data source.",{"title":118,"path":119,"stem":120,"description":2279,"icon":121,"children":-1},"Try the latest Nitro changes before they are released, with builds published automatically for every commit to the main branch.",1784019072607]