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