[{"data":1,"prerenderedAt":2131},["ShallowReactive",2],{"navigation":3,"-deploy-providers-cloudflare":394,"-deploy-providers-cloudflare-surround":2126},[4,88,217,223,379,391],{"title":5,"path":6,"stem":7,"children":8,"icon":87},"","/docs","1.docs/1.index",[9,12,17,22,27,32,37,42,47,52,57,62,67,72,77,82],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-compass",{"title":13,"path":14,"stem":15,"icon":16},"Quick Start","/docs/quick-start","1.docs/2.quick-start","i-lucide-zap",{"title":18,"path":19,"stem":20,"icon":21},"Renderer","/docs/renderer","1.docs/4.renderer","ri:layout-masonry-line",{"title":23,"path":24,"stem":25,"icon":26},"Routing","/docs/routing","1.docs/5.routing","ri:direction-line",{"title":28,"path":29,"stem":30,"icon":31},"Assets","/docs/assets","1.docs/50.assets","ri:image-2-line",{"title":33,"path":34,"stem":35,"icon":36},"Configuration","/docs/configuration","1.docs/50.configuration","ri:settings-3-line",{"title":38,"path":39,"stem":40,"icon":41},"Database","/docs/database","1.docs/50.database","ri:database-2-line",{"title":43,"path":44,"stem":45,"icon":46},"Lifecycle","/docs/lifecycle","1.docs/50.lifecycle","i-lucide-layers",{"title":48,"path":49,"stem":50,"icon":51},"OpenAPI","/docs/openapi","1.docs/50.openapi","ri:contract-line",{"title":53,"path":54,"stem":55,"icon":56},"Plugins","/docs/plugins","1.docs/50.plugins","ri:plug-line",{"title":58,"path":59,"stem":60,"icon":61},"Tasks","/docs/tasks","1.docs/50.tasks","codicon:run-all",{"title":63,"path":64,"stem":65,"icon":66},"Server Entry","/docs/server-entry","1.docs/6.server-entry","ri:server-line",{"title":68,"path":69,"stem":70,"icon":71},"Cache","/docs/cache","1.docs/7.cache","ri:speed-line",{"title":73,"path":74,"stem":75,"icon":76},"KV Storage","/docs/storage","1.docs/8.storage","carbon:datastore",{"title":78,"path":79,"stem":80,"icon":81},"Migration Guide","/docs/migration","1.docs/99.migration","ri:arrow-right-up-line",{"title":83,"path":84,"stem":85,"icon":86},"Nightly Channel","/docs/nightly","1.docs/99.nightly","ri:moon-fill","i-lucide-book-open",{"title":89,"path":90,"stem":91,"children":92,"icon":94},"Deploy","/deploy","2.deploy/0.index",[93,95,116],{"title":89,"path":90,"stem":91,"icon":94},"ri:upload-cloud-2-line",{"title":96,"path":97,"stem":98,"children":99,"page":115},"Runtimes","/deploy/runtimes","2.deploy/10.runtimes",[100,105,110],{"title":101,"path":102,"stem":103,"icon":104},"Node.js","/deploy/runtimes/node","2.deploy/10.runtimes/1.node","akar-icons:node-fill",{"title":106,"path":107,"stem":108,"icon":109},"Bun","/deploy/runtimes/bun","2.deploy/10.runtimes/bun","simple-icons:bun",{"title":111,"path":112,"stem":113,"icon":114},"Deno","/deploy/runtimes/deno","2.deploy/10.runtimes/deno","simple-icons:deno",false,{"title":117,"path":118,"stem":119,"children":120,"page":115},"Providers","/deploy/providers","2.deploy/20.providers",[121,125,129,133,137,141,145,149,153,157,161,165,169,173,177,181,185,189,193,197,201,205,209,213],{"title":122,"path":123,"stem":124},"Alwaysdata","/deploy/providers/alwaysdata","2.deploy/20.providers/alwaysdata",{"title":126,"path":127,"stem":128},"AWS Lambda","/deploy/providers/aws","2.deploy/20.providers/aws",{"title":130,"path":131,"stem":132},"AWS Amplify","/deploy/providers/aws-amplify","2.deploy/20.providers/aws-amplify",{"title":134,"path":135,"stem":136},"Azure","/deploy/providers/azure","2.deploy/20.providers/azure",{"title":138,"path":139,"stem":140},"Cleavr","/deploy/providers/cleavr","2.deploy/20.providers/cleavr",{"title":142,"path":143,"stem":144},"Cloudflare","/deploy/providers/cloudflare","2.deploy/20.providers/cloudflare",{"title":146,"path":147,"stem":148},"Deno Deploy","/deploy/providers/deno-deploy","2.deploy/20.providers/deno-deploy",{"title":150,"path":151,"stem":152},"DigitalOcean","/deploy/providers/digitalocean","2.deploy/20.providers/digitalocean",{"title":154,"path":155,"stem":156},"Firebase","/deploy/providers/firebase","2.deploy/20.providers/firebase",{"title":158,"path":159,"stem":160},"Flightcontrol","/deploy/providers/flightcontrol","2.deploy/20.providers/flightcontrol",{"title":162,"path":163,"stem":164},"Genezio","/deploy/providers/genezio","2.deploy/20.providers/genezio",{"title":166,"path":167,"stem":168},"GitHub Pages","/deploy/providers/github-pages","2.deploy/20.providers/github-pages",{"title":170,"path":171,"stem":172},"GitLab Pages","/deploy/providers/gitlab-pages","2.deploy/20.providers/gitlab-pages",{"title":174,"path":175,"stem":176},"Heroku","/deploy/providers/heroku","2.deploy/20.providers/heroku",{"title":178,"path":179,"stem":180},"IIS","/deploy/providers/iis","2.deploy/20.providers/iis",{"title":182,"path":183,"stem":184},"Koyeb","/deploy/providers/koyeb","2.deploy/20.providers/koyeb",{"title":186,"path":187,"stem":188},"Netlify","/deploy/providers/netlify","2.deploy/20.providers/netlify",{"title":190,"path":191,"stem":192},"Platform.sh","/deploy/providers/platform-sh","2.deploy/20.providers/platform-sh",{"title":194,"path":195,"stem":196},"Render.com","/deploy/providers/render","2.deploy/20.providers/render",{"title":198,"path":199,"stem":200},"StormKit","/deploy/providers/stormkit","2.deploy/20.providers/stormkit",{"title":202,"path":203,"stem":204},"Vercel","/deploy/providers/vercel","2.deploy/20.providers/vercel",{"title":206,"path":207,"stem":208},"Zeabur","/deploy/providers/zeabur","2.deploy/20.providers/zeabur",{"title":210,"path":211,"stem":212},"Zephyr Cloud","/deploy/providers/zephyr","2.deploy/20.providers/zephyr",{"title":214,"path":215,"stem":216},"Zerops","/deploy/providers/zerops","2.deploy/20.providers/zerops",{"title":218,"path":219,"stem":220,"children":221,"icon":36},"Config","/config","3.config/0.index",[222],{"title":218,"path":219,"stem":220,"icon":36},{"title":224,"path":225,"stem":226,"children":227,"icon":229},"Examples","/examples","4.examples/0.index",[228,230,235,240,245,250,254,259,264,269,274,279,284,288,293,297,301,306,311,316,321,326,331,336,341,346,350,355,360,364,369,374],{"title":224,"path":225,"stem":226,"icon":229},"i-lucide-folder-code",{"title":231,"path":232,"stem":233,"icon":234},"API Routes","/examples/api-routes","4.examples/api-routes","i-lucide-route",{"title":236,"path":237,"stem":238,"icon":239},"Auto Imports","/examples/auto-imports","4.examples/auto-imports","i-lucide-import",{"title":241,"path":242,"stem":243,"icon":244},"Cached Handler","/examples/cached-handler","4.examples/cached-handler","i-lucide-clock",{"title":246,"path":247,"stem":248,"icon":249},"Custom Error Handler","/examples/custom-error-handler","4.examples/custom-error-handler","i-lucide-alert-circle",{"title":38,"path":251,"stem":252,"icon":253},"/examples/database","4.examples/database","i-lucide-database",{"title":255,"path":256,"stem":257,"icon":258},"Elysia","/examples/elysia","4.examples/elysia","i-skill-icons-elysia-dark",{"title":260,"path":261,"stem":262,"icon":263},"Express","/examples/express","4.examples/express","i-simple-icons-express",{"title":265,"path":266,"stem":267,"icon":268},"Fastify","/examples/fastify","4.examples/fastify","i-simple-icons-fastify",{"title":270,"path":271,"stem":272,"icon":273},"Hello World","/examples/hello-world","4.examples/hello-world","i-lucide-sparkles",{"title":275,"path":276,"stem":277,"icon":278},"Hono","/examples/hono","4.examples/hono","i-logos-hono",{"title":280,"path":281,"stem":282,"icon":283},"Import Alias","/examples/import-alias","4.examples/import-alias","i-lucide-at-sign",{"title":285,"path":286,"stem":287,"icon":46},"Middleware","/examples/middleware","4.examples/middleware",{"title":289,"path":290,"stem":291,"icon":292},"Mono JSX","/examples/mono-jsx","4.examples/mono-jsx","i-lucide-brackets",{"title":294,"path":295,"stem":296,"icon":292},"Nano JSX","/examples/nano-jsx","4.examples/nano-jsx",{"title":53,"path":298,"stem":299,"icon":300},"/examples/plugins","4.examples/plugins","i-lucide-plug",{"title":302,"path":303,"stem":304,"icon":305},"Custom Renderer","/examples/renderer","4.examples/renderer","i-lucide-code",{"title":307,"path":308,"stem":309,"icon":310},"Runtime Config","/examples/runtime-config","4.examples/runtime-config","i-lucide-settings",{"title":312,"path":313,"stem":314,"icon":315},"Server Fetch","/examples/server-fetch","4.examples/server-fetch","i-lucide-arrow-right-left",{"title":317,"path":318,"stem":319,"icon":320},"Shiki","/examples/shiki","4.examples/shiki","i-lucide-highlighter",{"title":322,"path":323,"stem":324,"icon":325},"Virtual Routes","/examples/virtual-routes","4.examples/virtual-routes","i-lucide-box",{"title":327,"path":328,"stem":329,"icon":330},"Vite Nitro Plugin","/examples/vite-nitro-plugin","4.examples/vite-nitro-plugin","i-logos-vitejs",{"title":332,"path":333,"stem":334,"icon":335},"Vite RSC","/examples/vite-rsc","4.examples/vite-rsc","i-logos-react",{"title":337,"path":338,"stem":339,"icon":340},"Vite SSR HTML","/examples/vite-ssr-html","4.examples/vite-ssr-html","i-logos-html-5",{"title":342,"path":343,"stem":344,"icon":345},"SSR with Preact","/examples/vite-ssr-preact","4.examples/vite-ssr-preact","i-logos-preact",{"title":347,"path":348,"stem":349,"icon":335},"SSR with React","/examples/vite-ssr-react","4.examples/vite-ssr-react",{"title":351,"path":352,"stem":353,"icon":354},"SSR with SolidJS","/examples/vite-ssr-solid","4.examples/vite-ssr-solid","i-logos-solidjs-icon",{"title":356,"path":357,"stem":358,"icon":359},"SSR with TanStack Router","/examples/vite-ssr-tsr-react","4.examples/vite-ssr-tsr-react","i-simple-icons-tanstack",{"title":361,"path":362,"stem":363,"icon":359},"SSR with TanStack Start","/examples/vite-ssr-tss-react","4.examples/vite-ssr-tss-react",{"title":365,"path":366,"stem":367,"icon":368},"SSR with Vue Router","/examples/vite-ssr-vue-router","4.examples/vite-ssr-vue-router","i-logos-vue",{"title":370,"path":371,"stem":372,"icon":373},"Vite + tRPC","/examples/vite-trpc","4.examples/vite-trpc","i-simple-icons-trpc",{"title":375,"path":376,"stem":377,"icon":378},"WebSocket","/examples/websocket","4.examples/websocket","i-lucide-radio",{"title":380,"path":381,"stem":382,"children":383},"Blog","/blog","9.blog",[384,387],{"title":380,"path":381,"stem":385,"icon":386},"9.blog/index","i-lucide-file-text",{"title":388,"path":389,"stem":390,"icon":386},"Nitro v3 Beta is here!","/blog/v3-beta","9.blog/1.v3-beta",{"title":5,"path":392,"stem":393},"/","index",{"id":395,"title":142,"body":396,"description":2120,"extension":2121,"meta":2122,"navigation":2123,"path":143,"seo":2124,"stem":144,"__hash__":2125},"content/2.deploy/20.providers/cloudflare.md",{"type":397,"value":398,"toc":2096},"minimark",[399,404,416,420,439,449,456,572,595,614,619,628,632,636,640,643,646,649,652,655,659,671,673,716,720,727,802,805,814,823,860,864,881,1001,1004,1008,1015,1018,1024,1034,1039,1106,1123,1126,1131,1133,1136,1139,1142,1144,1146,1149,1153,1162,1178,1182,1193,1202,1216,1346,1350,1360,1386,1402,1406,1429,1440,1450,1454,1465,1474,1482,1487,1491,1662,1666,1680,1694,1705,1708,1710,1717,1837,1841,1852,1857,1989,1996,2000,2003,2006,2015,2020,2023,2092],[400,401,403],"h2",{"id":402},"cloudflare-workers","Cloudflare Workers",[405,406,407,411,412],"p",{},[408,409,410],"strong",{},"Preset:"," ",[413,414,415],"code",{},"cloudflare_module",[417,418],"read-more",{"to":419,"title":403},"https://developers.cloudflare.com/workers/",[421,422,423],"note",{},[405,424,425,426,431,432,438],{},"Integration with this provider is possible with ",[427,428,430],"a",{"href":429},"/deploy#zero-config-providers","zero configuration"," supporting ",[427,433,437],{"href":434,"rel":435},"https://developers.cloudflare.com/workers/ci-cd/builds/",[436],"nofollow","workers builds (beta)",".",[440,441,442],"important",{},[405,443,444,445,448],{},"To use Workers with Static Assets, you need a Nitro compatibility date set to ",[413,446,447],{},"2024-09-19"," or later.",[405,450,451,452,455],{},"The following shows an example ",[413,453,454],{},"nitro.config.ts"," file for deploying a Nitro app to Cloudflare Workers.",[457,458,462],"pre",{"className":459,"code":460,"filename":454,"language":461,"meta":5,"style":5},"language-ts shiki shiki-themes github-light github-dark github-dark","import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n    compatibilityDate: \"2024-09-19\",\n    preset: \"cloudflare_module\",\n    cloudflare: {\n      deployConfig: true,\n      nodeCompat: true\n    }\n})\n","ts",[413,463,464,487,494,510,522,533,539,551,560,566],{"__ignoreMap":5},[465,466,469,473,477,480,484],"span",{"class":467,"line":468},"line",1,[465,470,472],{"class":471},"so5gQ","import",[465,474,476],{"class":475},"slsVL"," { defineNitroConfig } ",[465,478,479],{"class":471},"from",[465,481,483],{"class":482},"sfrk1"," \"nitro/config\"",[465,485,486],{"class":475},";\n",[465,488,490],{"class":467,"line":489},2,[465,491,493],{"emptyLinePlaceholder":492},true,"\n",[465,495,497,500,503,507],{"class":467,"line":496},3,[465,498,499],{"class":471},"export",[465,501,502],{"class":471}," default",[465,504,506],{"class":505},"shcOC"," defineNitroConfig",[465,508,509],{"class":475},"({\n",[465,511,513,516,519],{"class":467,"line":512},4,[465,514,515],{"class":475},"    compatibilityDate: ",[465,517,518],{"class":482},"\"2024-09-19\"",[465,520,521],{"class":475},",\n",[465,523,525,528,531],{"class":467,"line":524},5,[465,526,527],{"class":475},"    preset: ",[465,529,530],{"class":482},"\"cloudflare_module\"",[465,532,521],{"class":475},[465,534,536],{"class":467,"line":535},6,[465,537,538],{"class":475},"    cloudflare: {\n",[465,540,542,545,549],{"class":467,"line":541},7,[465,543,544],{"class":475},"      deployConfig: ",[465,546,548],{"class":547},"suiK_","true",[465,550,521],{"class":475},[465,552,554,557],{"class":467,"line":553},8,[465,555,556],{"class":475},"      nodeCompat: ",[465,558,559],{"class":547},"true\n",[465,561,563],{"class":467,"line":562},9,[465,564,565],{"class":475},"    }\n",[465,567,569],{"class":467,"line":568},10,[465,570,571],{"class":475},"})\n",[405,573,574,575,578,579,582,583,588,589,594],{},"By setting ",[413,576,577],{},"deployConfig: true",", Nitro will automatically generate a ",[413,580,581],{},"wrangler.json"," for you with the correct configuration.\nIf you need to add ",[427,584,587],{"href":585,"rel":586},"https://developers.cloudflare.com/workers/wrangler/configuration/",[436],"Cloudflare Workers configuration",", such as ",[427,590,593],{"href":591,"rel":592},"https://developers.cloudflare.com/workers/runtime-apis/bindings/",[436],"bindings",", you can either:",[596,597,598,608],"ul",{},[599,600,601,602,605,606,438],"li",{},"Set these in your Nitro config under the ",[413,603,604],{},"cloudflare: { wrangler : {} }",". This has the same type as ",[413,607,581],{},[599,609,610,611,613],{},"Provide your own ",[413,612,581],{},". Nitro will merge your config with the appropriate settings, including pointing to the build output.",[615,616,618],"h3",{"id":617},"local-preview","Local Preview",[405,620,621,622,627],{},"You can use ",[427,623,626],{"href":624,"rel":625},"https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler",[436],"Wrangler"," to preview your app locally:",[629,630],"pm-run",{"script":631},"build",[633,634],"pm-x",{"command":635},"wrangler dev",[615,637,639],{"id":638},"manual-deploy","Manual Deploy",[405,641,642],{},"After having built your application you can manually deploy it with Wrangler.",[405,644,645],{},"First make sure to be logged into your Cloudflare account:",[633,647],{"command":648},"wrangler login",[405,650,651],{},"Then you can deploy the application with:",[633,653],{"command":654},"wrangler deploy",[615,656,658],{"id":657},"runtime-hooks","Runtime Hooks",[405,660,621,661,665,666,438],{},[427,662,664],{"href":663},"/docs/plugins#nitro-runtime-hooks","runtime hooks"," below in order to extend ",[427,667,670],{"href":668,"rel":669},"https://developers.cloudflare.com/workers/runtime-apis/handlers/",[436],"Worker handlers",[417,672],{"to":663},[596,674,675,684,693,702,711],{},[599,676,677],{},[427,678,681],{"href":679,"rel":680},"https://developers.cloudflare.com/workers/runtime-apis/handlers/scheduled/",[436],[413,682,683],{},"cloudflare:scheduled",[599,685,686],{},[427,687,690],{"href":688,"rel":689},"https://developers.cloudflare.com/email-routing/email-workers/runtime-api/",[436],[413,691,692],{},"cloudflare:email",[599,694,695],{},[427,696,699],{"href":697,"rel":698},"https://developers.cloudflare.com/queues/configuration/javascript-apis/#consumer",[436],[413,700,701],{},"cloudflare:queue",[599,703,704],{},[427,705,708],{"href":706,"rel":707},"https://developers.cloudflare.com/workers/runtime-apis/handlers/tail/",[436],[413,709,710],{},"cloudflare:tail",[599,712,713],{},[413,714,715],{},"cloudflare:trace",[615,717,719],{"id":718},"additional-exports","Additional Exports",[405,721,722,723,726],{},"You can add a ",[413,724,725],{},"exports.cloudflare.ts"," file to your project root to export additional handlers or properties to the Cloudflare Worker entrypoint.",[457,728,730],{"className":459,"code":729,"filename":725,"language":461,"meta":5,"style":5},"export class MyWorkflow extends WorkflowEntrypoint {\n  async run(event: WorkflowEvent, step: WorkflowStep) {\n    // ...\n  }\n}\n",[413,731,732,751,786,792,797],{"__ignoreMap":5},[465,733,734,736,739,742,745,748],{"class":467,"line":468},[465,735,499],{"class":471},[465,737,738],{"class":471}," class",[465,740,741],{"class":505}," MyWorkflow",[465,743,744],{"class":471}," extends",[465,746,747],{"class":505}," WorkflowEntrypoint",[465,749,750],{"class":475}," {\n",[465,752,753,756,759,762,766,769,772,775,778,780,783],{"class":467,"line":489},[465,754,755],{"class":471},"  async",[465,757,758],{"class":505}," run",[465,760,761],{"class":475},"(",[465,763,765],{"class":764},"sQHwn","event",[465,767,768],{"class":471},":",[465,770,771],{"class":505}," WorkflowEvent",[465,773,774],{"class":475},", ",[465,776,777],{"class":764},"step",[465,779,768],{"class":471},[465,781,782],{"class":505}," WorkflowStep",[465,784,785],{"class":475},") {\n",[465,787,788],{"class":467,"line":496},[465,789,791],{"class":790},"sCsY4","    // ...\n",[465,793,794],{"class":467,"line":512},[465,795,796],{"class":475},"  }\n",[465,798,799],{"class":467,"line":524},[465,800,801],{"class":475},"}\n",[405,803,804],{},"Nitro will automatically detect this file and include its exports in the final build.",[806,807,808],"warning",{},[405,809,810,811,813],{},"The ",[413,812,725],{}," file must not have a default export.",[405,815,816,817,820,821,768],{},"You can also customize the entrypoint file location using the ",[413,818,819],{},"cloudflare.exports"," option in your ",[413,822,454],{},[457,824,826],{"className":459,"code":825,"filename":454,"language":461,"meta":5,"style":5},"export default defineConfig({\n  cloudflare: {\n    exports: \"custom-exports-entry.ts\"\n  }\n})\n",[413,827,828,839,844,852,856],{"__ignoreMap":5},[465,829,830,832,834,837],{"class":467,"line":468},[465,831,499],{"class":471},[465,833,502],{"class":471},[465,835,836],{"class":505}," defineConfig",[465,838,509],{"class":475},[465,840,841],{"class":467,"line":489},[465,842,843],{"class":475},"  cloudflare: {\n",[465,845,846,849],{"class":467,"line":496},[465,847,848],{"class":475},"    exports: ",[465,850,851],{"class":482},"\"custom-exports-entry.ts\"\n",[465,853,854],{"class":467,"line":512},[465,855,796],{"class":475},[465,857,858],{"class":467,"line":524},[465,859,571],{"class":475},[615,861,863],{"id":862},"scheduled-tasks-cron-triggers","Scheduled Tasks (Cron Triggers)",[405,865,866,867,870,871,874,875,880],{},"When using ",[427,868,869],{"href":59},"Nitro tasks"," with ",[413,872,873],{},"scheduledTasks",", Nitro automatically generates ",[427,876,879],{"href":877,"rel":878},"https://developers.cloudflare.com/workers/configuration/cron-triggers/",[436],"Cron Triggers"," in the wrangler config at build time.",[457,882,884],{"className":459,"code":883,"filename":454,"language":461,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  preset: \"cloudflare_module\",\n  experimental: {\n    tasks: true,\n  },\n  scheduledTasks: {\n    \"* * * * *\": [\"cms:update\"],\n    \"0 15 1 * *\": [\"db:cleanup\"],\n  },\n  cloudflare: {\n    deployConfig: true,\n  },\n})\n",[413,885,886,898,902,912,921,926,935,940,945,959,971,976,981,991,996],{"__ignoreMap":5},[465,887,888,890,892,894,896],{"class":467,"line":468},[465,889,472],{"class":471},[465,891,476],{"class":475},[465,893,479],{"class":471},[465,895,483],{"class":482},[465,897,486],{"class":475},[465,899,900],{"class":467,"line":489},[465,901,493],{"emptyLinePlaceholder":492},[465,903,904,906,908,910],{"class":467,"line":496},[465,905,499],{"class":471},[465,907,502],{"class":471},[465,909,506],{"class":505},[465,911,509],{"class":475},[465,913,914,917,919],{"class":467,"line":512},[465,915,916],{"class":475},"  preset: ",[465,918,530],{"class":482},[465,920,521],{"class":475},[465,922,923],{"class":467,"line":524},[465,924,925],{"class":475},"  experimental: {\n",[465,927,928,931,933],{"class":467,"line":535},[465,929,930],{"class":475},"    tasks: ",[465,932,548],{"class":547},[465,934,521],{"class":475},[465,936,937],{"class":467,"line":541},[465,938,939],{"class":475},"  },\n",[465,941,942],{"class":467,"line":553},[465,943,944],{"class":475},"  scheduledTasks: {\n",[465,946,947,950,953,956],{"class":467,"line":562},[465,948,949],{"class":482},"    \"* * * * *\"",[465,951,952],{"class":475},": [",[465,954,955],{"class":482},"\"cms:update\"",[465,957,958],{"class":475},"],\n",[465,960,961,964,966,969],{"class":467,"line":568},[465,962,963],{"class":482},"    \"0 15 1 * *\"",[465,965,952],{"class":475},[465,967,968],{"class":482},"\"db:cleanup\"",[465,970,958],{"class":475},[465,972,974],{"class":467,"line":973},11,[465,975,939],{"class":475},[465,977,979],{"class":467,"line":978},12,[465,980,843],{"class":475},[465,982,984,987,989],{"class":467,"line":983},13,[465,985,986],{"class":475},"    deployConfig: ",[465,988,548],{"class":547},[465,990,521],{"class":475},[465,992,994],{"class":467,"line":993},14,[465,995,939],{"class":475},[465,997,999],{"class":467,"line":998},15,[465,1000,571],{"class":475},[405,1002,1003],{},"No manual Wrangler configuration is needed - Nitro handles it for you.",[400,1005,1007],{"id":1006},"cloudflare-pages","Cloudflare Pages",[405,1009,1010,411,1012],{},[408,1011,410],{},[413,1013,1014],{},"cloudflare_pages",[417,1016],{"to":1017,"title":1007},"https://pages.cloudflare.com/",[421,1019,1020],{},[405,1021,425,1022,438],{},[427,1023,430],{"href":429},[806,1025,1026],{},[405,1027,1028,1029,1033],{},"Cloudflare ",[427,1030,1032],{"href":1031},"#cloudflare-workers","Workers Module"," is the new recommended preset for deployments. Please consider using the pages only if you need specific features.",[405,1035,451,1036,1038],{},[413,1037,454],{}," file for deploying a Nitro app to Cloudflare Pages.",[457,1040,1042],{"className":459,"code":1041,"filename":454,"language":461,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n    preset: \"cloudflare_pages\",\n    cloudflare: {\n      deployConfig: true,\n      nodeCompat:true\n    }\n})\n",[413,1043,1044,1056,1060,1070,1079,1083,1091,1098,1102],{"__ignoreMap":5},[465,1045,1046,1048,1050,1052,1054],{"class":467,"line":468},[465,1047,472],{"class":471},[465,1049,476],{"class":475},[465,1051,479],{"class":471},[465,1053,483],{"class":482},[465,1055,486],{"class":475},[465,1057,1058],{"class":467,"line":489},[465,1059,493],{"emptyLinePlaceholder":492},[465,1061,1062,1064,1066,1068],{"class":467,"line":496},[465,1063,499],{"class":471},[465,1065,502],{"class":471},[465,1067,506],{"class":505},[465,1069,509],{"class":475},[465,1071,1072,1074,1077],{"class":467,"line":512},[465,1073,527],{"class":475},[465,1075,1076],{"class":482},"\"cloudflare_pages\"",[465,1078,521],{"class":475},[465,1080,1081],{"class":467,"line":524},[465,1082,538],{"class":475},[465,1084,1085,1087,1089],{"class":467,"line":535},[465,1086,544],{"class":475},[465,1088,548],{"class":547},[465,1090,521],{"class":475},[465,1092,1093,1096],{"class":467,"line":541},[465,1094,1095],{"class":475},"      nodeCompat:",[465,1097,559],{"class":547},[465,1099,1100],{"class":467,"line":553},[465,1101,565],{"class":475},[465,1103,1104],{"class":467,"line":562},[465,1105,571],{"class":475},[405,1107,1108,1109,1112,1113,1116,1117,1122],{},"Nitro automatically generates a ",[413,1110,1111],{},"_routes.json"," file that controls which routes get served from files and which are served from the Worker script. The auto-generated routes file can be overridden with the config option ",[413,1114,1115],{},"cloudflare.pages.routes"," (",[427,1118,1121],{"href":1119,"rel":1120},"https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes",[436],"read more",").",[615,1124,618],{"id":1125},"local-preview-1",[405,1127,621,1128,627],{},[427,1129,626],{"href":624,"rel":1130},[436],[629,1132],{"script":631},[633,1134],{"command":1135},"wrangler pages dev",[615,1137,639],{"id":1138},"manual-deploy-1",[405,1140,1141],{},"After having built your application you can manually deploy it with Wrangler, in order to do so first make sure to be\nlogged into your Cloudflare account:",[633,1143],{"command":648},[405,1145,651],{},[633,1147],{"command":1148},"wrangler pages deploy",[400,1150,1152],{"id":1151},"deploy-within-cicd-using-github-actions","Deploy within CI/CD using GitHub Actions",[405,1154,1155,1156,1161],{},"Regardless on whether you're using Cloudflare Pages or Cloudflare Workers, you can use the ",[427,1157,1160],{"href":1158,"rel":1159},"https://github.com/marketplace/actions/deploy-to-cloudflare-workers-with-wrangler",[436],"Wrangler GitHub actions"," to deploy your application.",[421,1163,1164],{},[405,1165,1166,1169,1170,1174,1175,1177],{},[408,1167,1168],{},"Note:"," Remember to ",[427,1171,1173],{"href":1172},"/deploy#changing-the-deployment-preset","instruct Nitro to use the correct preset"," (note that this is necessary for all presets including the ",[413,1176,1014],{}," one).",[400,1179,1181],{"id":1180},"environment-variables","Environment Variables",[405,1183,1184,1185,1188,1189,1192],{},"Nitro allows you to universally access environment variables using ",[413,1186,1187],{},"process.env"," or ",[413,1190,1191],{},"import.meta.env"," or the runtime config.",[421,1194,1195],{},[405,1196,1197,1198,1201],{},"Make sure to only access environment variables ",[408,1199,1200],{},"within the event lifecycle","  and not in global contexts since Cloudflare only makes them available during the request lifecycle and not before.",[405,1203,1204,1207,1208,1211,1212,1215],{},[408,1205,1206],{},"Example:"," If you have set the ",[413,1209,1210],{},"SECRET"," and ",[413,1213,1214],{},"NITRO_HELLO_THERE"," environment variables set you can access them in the following way:",[457,1217,1219],{"className":459,"code":1218,"language":461,"meta":5,"style":5},"import { defineHandler } from \"nitro\";\nimport { useRuntimeConfig } from \"nitro/runtime-config\";\n\nconsole.log(process.env.SECRET) // note that this is in the global scope! so it doesn't actually work and the variable is undefined!\n\nexport default defineHandler((event) => {\n  // note that all the below are valid ways of accessing the above mentioned variables\n  useRuntimeConfig().helloThere\n  useRuntimeConfig().secret\n  process.env.NITRO_HELLO_THERE\n  import.meta.env.SECRET\n});\n",[413,1220,1221,1235,1249,1253,1272,1276,1297,1302,1310,1317,1325,1341],{"__ignoreMap":5},[465,1222,1223,1225,1228,1230,1233],{"class":467,"line":468},[465,1224,472],{"class":471},[465,1226,1227],{"class":475}," { defineHandler } ",[465,1229,479],{"class":471},[465,1231,1232],{"class":482}," \"nitro\"",[465,1234,486],{"class":475},[465,1236,1237,1239,1242,1244,1247],{"class":467,"line":489},[465,1238,472],{"class":471},[465,1240,1241],{"class":475}," { useRuntimeConfig } ",[465,1243,479],{"class":471},[465,1245,1246],{"class":482}," \"nitro/runtime-config\"",[465,1248,486],{"class":475},[465,1250,1251],{"class":467,"line":496},[465,1252,493],{"emptyLinePlaceholder":492},[465,1254,1255,1258,1261,1264,1266,1269],{"class":467,"line":512},[465,1256,1257],{"class":475},"console.",[465,1259,1260],{"class":505},"log",[465,1262,1263],{"class":475},"(process.env.",[465,1265,1210],{"class":547},[465,1267,1268],{"class":475},") ",[465,1270,1271],{"class":790},"// note that this is in the global scope! so it doesn't actually work and the variable is undefined!\n",[465,1273,1274],{"class":467,"line":524},[465,1275,493],{"emptyLinePlaceholder":492},[465,1277,1278,1280,1282,1285,1288,1290,1292,1295],{"class":467,"line":535},[465,1279,499],{"class":471},[465,1281,502],{"class":471},[465,1283,1284],{"class":505}," defineHandler",[465,1286,1287],{"class":475},"((",[465,1289,765],{"class":764},[465,1291,1268],{"class":475},[465,1293,1294],{"class":471},"=>",[465,1296,750],{"class":475},[465,1298,1299],{"class":467,"line":541},[465,1300,1301],{"class":790},"  // note that all the below are valid ways of accessing the above mentioned variables\n",[465,1303,1304,1307],{"class":467,"line":553},[465,1305,1306],{"class":505},"  useRuntimeConfig",[465,1308,1309],{"class":475},"().helloThere\n",[465,1311,1312,1314],{"class":467,"line":562},[465,1313,1306],{"class":505},[465,1315,1316],{"class":475},"().secret\n",[465,1318,1319,1322],{"class":467,"line":568},[465,1320,1321],{"class":475},"  process.env.",[465,1323,1324],{"class":547},"NITRO_HELLO_THERE\n",[465,1326,1327,1330,1332,1335,1338],{"class":467,"line":973},[465,1328,1329],{"class":471},"  import",[465,1331,438],{"class":475},[465,1333,1334],{"class":547},"meta",[465,1336,1337],{"class":475},".env.",[465,1339,1340],{"class":547},"SECRET\n",[465,1342,1343],{"class":467,"line":978},[465,1344,1345],{"class":475},"});\n",[615,1347,1349],{"id":1348},"specify-variables-in-development-mode","Specify Variables in Development Mode",[405,1351,1352,1353,1188,1356,1359],{},"For development, you can use a ",[413,1354,1355],{},".env",[413,1357,1358],{},".env.local"," file to specify environment variables:",[457,1361,1365],{"className":1362,"code":1363,"language":1364,"meta":5,"style":5},"language-ini shiki shiki-themes github-light github-dark github-dark","NITRO_HELLO_THERE=\"captain\"\nSECRET=\"top-secret\"\n","ini",[413,1366,1367,1377],{"__ignoreMap":5},[465,1368,1369,1371,1374],{"class":467,"line":468},[465,1370,1214],{"class":471},[465,1372,1373],{"class":475},"=",[465,1375,1376],{"class":482},"\"captain\"\n",[465,1378,1379,1381,1383],{"class":467,"line":489},[465,1380,1210],{"class":471},[465,1382,1373],{"class":475},[465,1384,1385],{"class":482},"\"top-secret\"\n",[421,1387,1388],{},[405,1389,1390,1392,1393,1211,1395,1397,1398,1401],{},[408,1391,1168],{}," Make sure you add ",[413,1394,1355],{},[413,1396,1358],{}," to the ",[413,1399,1400],{},".gitignore"," file so that you don't commit it as it can contain sensitive information.",[615,1403,1405],{"id":1404},"specify-variables-for-local-previews","Specify Variables for local previews",[405,1407,1408,1409,1188,1411,1413,1414,1417,1418,1211,1423,1428],{},"After build, when you try out your project locally with ",[413,1410,635],{},[413,1412,1135],{},", in order to have access to environment variables you will need to specify the in a ",[413,1415,1416],{},".dev.vars"," file in the root of your project (as presented in the ",[427,1419,1422],{"href":1420,"rel":1421},"https://developers.cloudflare.com/pages/functions/bindings/#interact-with-your-environment-variables-locally",[436],"Pages",[427,1424,1427],{"href":1425,"rel":1426},"https://developers.cloudflare.com/workers/configuration/environment-variables/#interact-with-environment-variables-locally",[436],"Workers"," documentation).",[405,1430,1431,1432,1188,1434,1436,1437,1439],{},"If you are using a ",[413,1433,1355],{},[413,1435,1358],{}," file while developing, your ",[413,1438,1416],{}," should be identical to it.",[421,1441,1442],{},[405,1443,1444,1392,1446,1397,1448,1401],{},[408,1445,1168],{},[413,1447,1416],{},[413,1449,1400],{},[615,1451,1453],{"id":1452},"specify-variables-for-production","Specify Variables for Production",[405,1455,1456,1457,1464],{},"For production, use the Cloudflare dashboard or the ",[427,1458,1461],{"href":1459,"rel":1460},"https://developers.cloudflare.com/workers/wrangler/commands/#secret",[436],[413,1462,1463],{},"wrangler secret"," command to set environment variables and secrets.",[615,1466,1468,1469,392,1472],{"id":1467},"specify-variables-using-wranglertomlwranglerjson","Specify Variables using ",[413,1470,1471],{},"wrangler.toml",[413,1473,581],{},[405,1475,1476,1477,392,1479,1481],{},"You can specify a custom ",[413,1478,1471],{},[413,1480,581],{}," file and define vars inside.",[806,1483,1484],{},[405,1485,1486],{},"Note that this isn't recommended for sensitive data like secrets.",[405,1488,1489],{},[408,1490,1206],{},[1492,1493,1494,1557],"code-group",{},[457,1495,1497],{"className":1362,"code":1496,"filename":1471,"language":1364,"meta":5,"style":5},"# Shared\n[vars]\nNITRO_HELLO_THERE=\"general\"\nSECRET=\"secret\"\n\n# Override values for `--env production` usage\n[env.production.vars]\nNITRO_HELLO_THERE=\"captain\"\nSECRET=\"top-secret\"\n",[413,1498,1499,1504,1509,1518,1527,1531,1536,1541,1549],{"__ignoreMap":5},[465,1500,1501],{"class":467,"line":468},[465,1502,1503],{"class":790},"# Shared\n",[465,1505,1506],{"class":467,"line":489},[465,1507,1508],{"class":505},"[vars]\n",[465,1510,1511,1513,1515],{"class":467,"line":496},[465,1512,1214],{"class":471},[465,1514,1373],{"class":475},[465,1516,1517],{"class":482},"\"general\"\n",[465,1519,1520,1522,1524],{"class":467,"line":512},[465,1521,1210],{"class":471},[465,1523,1373],{"class":475},[465,1525,1526],{"class":482},"\"secret\"\n",[465,1528,1529],{"class":467,"line":524},[465,1530,493],{"emptyLinePlaceholder":492},[465,1532,1533],{"class":467,"line":535},[465,1534,1535],{"class":790},"# Override values for `--env production` usage\n",[465,1537,1538],{"class":467,"line":541},[465,1539,1540],{"class":505},"[env.production.vars]\n",[465,1542,1543,1545,1547],{"class":467,"line":553},[465,1544,1214],{"class":471},[465,1546,1373],{"class":475},[465,1548,1376],{"class":482},[465,1550,1551,1553,1555],{"class":467,"line":562},[465,1552,1210],{"class":471},[465,1554,1373],{"class":475},[465,1556,1385],{"class":482},[457,1558,1562],{"className":1559,"code":1560,"filename":581,"language":1561,"meta":5,"style":5},"language-json shiki shiki-themes github-light github-dark github-dark","{\n  \"vars\": {\n    \"NITRO_HELLO_THERE\": \"general\",\n    \"SECRET\": \"secret\"\n  },\n  \"env\": {\n    \"production\": {\n      \"vars\": {\n        \"NITRO_HELLO_THERE\": \"captain\",\n        \"SECRET\": \"top-secret\"\n      }\n    }\n  }\n}\n\n","json",[413,1563,1564,1569,1577,1590,1599,1603,1610,1617,1624,1636,1645,1650,1654,1658],{"__ignoreMap":5},[465,1565,1566],{"class":467,"line":468},[465,1567,1568],{"class":475},"{\n",[465,1570,1571,1574],{"class":467,"line":489},[465,1572,1573],{"class":547},"  \"vars\"",[465,1575,1576],{"class":475},": {\n",[465,1578,1579,1582,1585,1588],{"class":467,"line":496},[465,1580,1581],{"class":547},"    \"NITRO_HELLO_THERE\"",[465,1583,1584],{"class":475},": ",[465,1586,1587],{"class":482},"\"general\"",[465,1589,521],{"class":475},[465,1591,1592,1595,1597],{"class":467,"line":512},[465,1593,1594],{"class":547},"    \"SECRET\"",[465,1596,1584],{"class":475},[465,1598,1526],{"class":482},[465,1600,1601],{"class":467,"line":524},[465,1602,939],{"class":475},[465,1604,1605,1608],{"class":467,"line":535},[465,1606,1607],{"class":547},"  \"env\"",[465,1609,1576],{"class":475},[465,1611,1612,1615],{"class":467,"line":541},[465,1613,1614],{"class":547},"    \"production\"",[465,1616,1576],{"class":475},[465,1618,1619,1622],{"class":467,"line":553},[465,1620,1621],{"class":547},"      \"vars\"",[465,1623,1576],{"class":475},[465,1625,1626,1629,1631,1634],{"class":467,"line":562},[465,1627,1628],{"class":547},"        \"NITRO_HELLO_THERE\"",[465,1630,1584],{"class":475},[465,1632,1633],{"class":482},"\"captain\"",[465,1635,521],{"class":475},[465,1637,1638,1641,1643],{"class":467,"line":568},[465,1639,1640],{"class":547},"        \"SECRET\"",[465,1642,1584],{"class":475},[465,1644,1385],{"class":482},[465,1646,1647],{"class":467,"line":973},[465,1648,1649],{"class":475},"      }\n",[465,1651,1652],{"class":467,"line":978},[465,1653,565],{"class":475},[465,1655,1656],{"class":467,"line":983},[465,1657,796],{"class":475},[465,1659,1660],{"class":467,"line":993},[465,1661,801],{"class":475},[400,1663,1665],{"id":1664},"direct-access-to-cloudflare-bindings","Direct access to Cloudflare bindings",[405,1667,1668,1669,1674,1675,1122],{},"Bindings are what allows you to interact with resources from the Cloudflare platform, examples of such resources are key-value data storages (",[427,1670,1673],{"href":1671,"rel":1672},"https://developers.cloudflare.com/kv/",[436],"KVs",") and serverless SQL databases (",[427,1676,1679],{"href":1677,"rel":1678},"https://developers.cloudflare.com/d1/",[436],"D1s",[417,1681,1682],{},[405,1683,1684,1685,1211,1689,1693],{},"For more details on Bindings and how to use them please refer to the Cloudflare ",[427,1686,1422],{"href":1687,"rel":1688},"https://developers.cloudflare.com/pages/functions/bindings/",[436],[427,1690,1427],{"href":1691,"rel":1692},"https://developers.cloudflare.com/workers/configuration/bindings/#bindings",[436]," documentation.",[1695,1696,1697],"tip",{},[405,1698,1699,1700,1211,1702,1704],{},"\nNitro provides high level API to interact with primitives such as ",[427,1701,73],{"href":74},[427,1703,38],{"href":39}," and you are highly recommended to prefer using them instead of directly depending on low-level APIs for usage stability.",[417,1706],{"to":39,"title":1707},"Database Layer",[417,1709],{"to":74,"title":73},[405,1711,1712,1713,1716],{},"In runtime, you can access bindings from the request event via ",[413,1714,1715],{},"event.req.runtime.cloudflare.env",". This is for example how you can access a D1 binding:",[457,1718,1720],{"className":459,"code":1719,"language":461,"meta":5,"style":5},"import { defineHandler } from \"nitro\";\n\ndefineHandler(async (event) => {\n  const { env } = event.req.runtime.cloudflare\n  const stmt = await env.MY_D1.prepare('SELECT id FROM table')\n  const { results } = await stmt.all()\n})\n",[413,1721,1722,1734,1738,1758,1777,1809,1833],{"__ignoreMap":5},[465,1723,1724,1726,1728,1730,1732],{"class":467,"line":468},[465,1725,472],{"class":471},[465,1727,1227],{"class":475},[465,1729,479],{"class":471},[465,1731,1232],{"class":482},[465,1733,486],{"class":475},[465,1735,1736],{"class":467,"line":489},[465,1737,493],{"emptyLinePlaceholder":492},[465,1739,1740,1743,1745,1748,1750,1752,1754,1756],{"class":467,"line":496},[465,1741,1742],{"class":505},"defineHandler",[465,1744,761],{"class":475},[465,1746,1747],{"class":471},"async",[465,1749,1116],{"class":475},[465,1751,765],{"class":764},[465,1753,1268],{"class":475},[465,1755,1294],{"class":471},[465,1757,750],{"class":475},[465,1759,1760,1763,1766,1769,1772,1774],{"class":467,"line":512},[465,1761,1762],{"class":471},"  const",[465,1764,1765],{"class":475}," { ",[465,1767,1768],{"class":547},"env",[465,1770,1771],{"class":475}," } ",[465,1773,1373],{"class":471},[465,1775,1776],{"class":475}," event.req.runtime.cloudflare\n",[465,1778,1779,1781,1784,1787,1790,1793,1796,1798,1801,1803,1806],{"class":467,"line":524},[465,1780,1762],{"class":471},[465,1782,1783],{"class":547}," stmt",[465,1785,1786],{"class":471}," =",[465,1788,1789],{"class":471}," await",[465,1791,1792],{"class":475}," env.",[465,1794,1795],{"class":547},"MY_D1",[465,1797,438],{"class":475},[465,1799,1800],{"class":505},"prepare",[465,1802,761],{"class":475},[465,1804,1805],{"class":482},"'SELECT id FROM table'",[465,1807,1808],{"class":475},")\n",[465,1810,1811,1813,1815,1818,1820,1822,1824,1827,1830],{"class":467,"line":535},[465,1812,1762],{"class":471},[465,1814,1765],{"class":475},[465,1816,1817],{"class":547},"results",[465,1819,1771],{"class":475},[465,1821,1373],{"class":471},[465,1823,1789],{"class":471},[465,1825,1826],{"class":475}," stmt.",[465,1828,1829],{"class":505},"all",[465,1831,1832],{"class":475},"()\n",[465,1834,1835],{"class":467,"line":541},[465,1836,571],{"class":475},[615,1838,1840],{"id":1839},"access-to-the-bindings-in-local-dev","Access to the bindings in local dev",[405,1842,1843,1844,392,1847,392,1849,1851],{},"To access bindings in dev mode, we first define them. You can do this in a ",[413,1845,1846],{},"wrangler.jsonc",[413,1848,581],{},[413,1850,1471],{}," file",[405,1853,1854,1855,768],{},"For example, to define a variable and a KV namespace in ",[413,1856,1471],{},[1492,1858,1859,1911],{},[457,1860,1862],{"className":1362,"code":1861,"filename":1471,"language":1364,"meta":5,"style":5},"[vars]\nMY_VARIABLE=\"my-value\"\n\n[[kv_namespaces]]\nbinding = \"MY_KV\"\nid = \"xxx\"\n",[413,1863,1864,1868,1878,1882,1890,1901],{"__ignoreMap":5},[465,1865,1866],{"class":467,"line":468},[465,1867,1508],{"class":505},[465,1869,1870,1873,1875],{"class":467,"line":489},[465,1871,1872],{"class":471},"MY_VARIABLE",[465,1874,1373],{"class":475},[465,1876,1877],{"class":482},"\"my-value\"\n",[465,1879,1880],{"class":467,"line":496},[465,1881,493],{"emptyLinePlaceholder":492},[465,1883,1884,1887],{"class":467,"line":512},[465,1885,1886],{"class":505},"[[kv_namespaces]",[465,1888,1889],{"class":475},"]\n",[465,1891,1892,1895,1898],{"class":467,"line":524},[465,1893,1894],{"class":471},"binding",[465,1896,1897],{"class":475}," = ",[465,1899,1900],{"class":482},"\"MY_KV\"\n",[465,1902,1903,1906,1908],{"class":467,"line":535},[465,1904,1905],{"class":471},"id",[465,1907,1897],{"class":475},[465,1909,1910],{"class":482},"\"xxx\"\n",[457,1912,1914],{"className":1559,"code":1913,"filename":581,"language":1561,"meta":5,"style":5},"{\n  \"vars\": {\n    \"MY_VARIABLE\": \"my-value\",\n  },\n  \"kv_namespaces\": [\n    {\n      \"binding\": \"MY_KV\",\n      \"id\": \"xxx\"\n    }\n  ]\n}\n",[413,1915,1916,1920,1926,1938,1942,1950,1955,1967,1976,1980,1985],{"__ignoreMap":5},[465,1917,1918],{"class":467,"line":468},[465,1919,1568],{"class":475},[465,1921,1922,1924],{"class":467,"line":489},[465,1923,1573],{"class":547},[465,1925,1576],{"class":475},[465,1927,1928,1931,1933,1936],{"class":467,"line":496},[465,1929,1930],{"class":547},"    \"MY_VARIABLE\"",[465,1932,1584],{"class":475},[465,1934,1935],{"class":482},"\"my-value\"",[465,1937,521],{"class":475},[465,1939,1940],{"class":467,"line":512},[465,1941,939],{"class":475},[465,1943,1944,1947],{"class":467,"line":524},[465,1945,1946],{"class":547},"  \"kv_namespaces\"",[465,1948,1949],{"class":475},": [\n",[465,1951,1952],{"class":467,"line":535},[465,1953,1954],{"class":475},"    {\n",[465,1956,1957,1960,1962,1965],{"class":467,"line":541},[465,1958,1959],{"class":547},"      \"binding\"",[465,1961,1584],{"class":475},[465,1963,1964],{"class":482},"\"MY_KV\"",[465,1966,521],{"class":475},[465,1968,1969,1972,1974],{"class":467,"line":553},[465,1970,1971],{"class":547},"      \"id\"",[465,1973,1584],{"class":475},[465,1975,1910],{"class":482},[465,1977,1978],{"class":467,"line":562},[465,1979,565],{"class":475},[465,1981,1982],{"class":467,"line":568},[465,1983,1984],{"class":475},"  ]\n",[465,1986,1987],{"class":467,"line":973},[465,1988,801],{"class":475},[405,1990,1991,1992,1995],{},"Next we install the required ",[413,1993,1994],{},"wrangler"," package (if not already installed):",[1997,1998],"pm-install",{"name":1999},"wrangler -D",[405,2001,2002],{},"From this moment, when running",[629,2004],{"script":2005},"dev",[405,2007,2008,2009,1211,2011,2014],{},"you will be able to access the ",[413,2010,1872],{},[413,2012,2013],{},"MY_KV"," from the request event just as illustrated above.",[2016,2017,2019],"h4",{"id":2018},"wrangler-environments","Wrangler environments",[405,2021,2022],{},"If you have multiple Wrangler environments, you can specify which Wrangler environment to use during Cloudflare dev emulation:",[457,2024,2026],{"className":459,"code":2025,"filename":454,"language":461,"meta":5,"style":5},"import { defineNitroConfig } from \"nitro/config\";\n\nexport default defineNitroConfig({\n  preset: 'cloudflare_module',\n  cloudflare: {\n    dev: {\n      environment: 'preview'\n    }\n  }\n})\n",[413,2027,2028,2040,2044,2054,2063,2067,2072,2080,2084,2088],{"__ignoreMap":5},[465,2029,2030,2032,2034,2036,2038],{"class":467,"line":468},[465,2031,472],{"class":471},[465,2033,476],{"class":475},[465,2035,479],{"class":471},[465,2037,483],{"class":482},[465,2039,486],{"class":475},[465,2041,2042],{"class":467,"line":489},[465,2043,493],{"emptyLinePlaceholder":492},[465,2045,2046,2048,2050,2052],{"class":467,"line":496},[465,2047,499],{"class":471},[465,2049,502],{"class":471},[465,2051,506],{"class":505},[465,2053,509],{"class":475},[465,2055,2056,2058,2061],{"class":467,"line":512},[465,2057,916],{"class":475},[465,2059,2060],{"class":482},"'cloudflare_module'",[465,2062,521],{"class":475},[465,2064,2065],{"class":467,"line":524},[465,2066,843],{"class":475},[465,2068,2069],{"class":467,"line":535},[465,2070,2071],{"class":475},"    dev: {\n",[465,2073,2074,2077],{"class":467,"line":541},[465,2075,2076],{"class":475},"      environment: ",[465,2078,2079],{"class":482},"'preview'\n",[465,2081,2082],{"class":467,"line":553},[465,2083,565],{"class":475},[465,2085,2086],{"class":467,"line":562},[465,2087,796],{"class":475},[465,2089,2090],{"class":467,"line":568},[465,2091,571],{"class":475},[2093,2094,2095],"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 pre.shiki code .shcOC, html code.shiki .shcOC{--shiki-light:#6F42C1;--shiki-default:#B392F0;--shiki-dark:#B392F0}html pre.shiki code .suiK_, html code.shiki .suiK_{--shiki-light:#005CC5;--shiki-default:#79B8FF;--shiki-dark:#79B8FF}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 .sQHwn, html code.shiki .sQHwn{--shiki-light:#E36209;--shiki-default:#FFAB70;--shiki-dark:#FFAB70}html pre.shiki code .sCsY4, html code.shiki .sCsY4{--shiki-light:#6A737D;--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":5,"searchDepth":489,"depth":489,"links":2097},[2098,2105,2109,2110,2117],{"id":402,"depth":489,"text":403,"children":2099},[2100,2101,2102,2103,2104],{"id":617,"depth":496,"text":618},{"id":638,"depth":496,"text":639},{"id":657,"depth":496,"text":658},{"id":718,"depth":496,"text":719},{"id":862,"depth":496,"text":863},{"id":1006,"depth":489,"text":1007,"children":2106},[2107,2108],{"id":1125,"depth":496,"text":618},{"id":1138,"depth":496,"text":639},{"id":1151,"depth":489,"text":1152},{"id":1180,"depth":489,"text":1181,"children":2111},[2112,2113,2114,2115],{"id":1348,"depth":496,"text":1349},{"id":1404,"depth":496,"text":1405},{"id":1452,"depth":496,"text":1453},{"id":1467,"depth":496,"text":2116},"Specify Variables using wrangler.toml/wrangler.json",{"id":1664,"depth":489,"text":1665,"children":2118},[2119],{"id":1839,"depth":496,"text":1840},"Deploy Nitro apps to Cloudflare.","md",{},{},{"title":142,"description":2120},"2THW8h9HGAuAKNwFw5r0GCh7a7pHuAoqd49dTtSq99E",[2127,2129],{"title":138,"path":139,"stem":140,"description":2128,"children":-1},"Deploy Nitro apps to Cleavr.",{"title":146,"path":147,"stem":148,"description":2130,"children":-1},"Deploy Nitro apps to Deno Deploy.",1775834862041]