[{"data":1,"prerenderedAt":2129},["ShallowReactive",2],{"navigation":3,"-deploy-providers-cloudflare":394,"-deploy-providers-cloudflare-surround":2124},[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":2118,"extension":2119,"meta":2120,"navigation":2121,"path":143,"seo":2122,"stem":144,"__hash__":2123},"content/2.deploy/20.providers/cloudflare.md",{"type":397,"value":398,"toc":2094},"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,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,1344,1348,1358,1384,1400,1404,1427,1438,1448,1452,1463,1472,1480,1485,1489,1660,1664,1678,1692,1703,1706,1708,1715,1835,1839,1850,1855,1987,1994,1998,2001,2004,2013,2018,2021,2090],[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 { defineConfig } from \"nitro\";\n\nexport default defineConfig({\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"," { defineConfig } ",[465,478,479],{"class":471},"from",[465,481,483],{"class":482},"sfrk1"," \"nitro\"",[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"," defineConfig",[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,838,843,851,855],{"__ignoreMap":5},[465,829,830,832,834,836],{"class":467,"line":468},[465,831,499],{"class":471},[465,833,502],{"class":471},[465,835,506],{"class":505},[465,837,509],{"class":475},[465,839,840],{"class":467,"line":489},[465,841,842],{"class":475},"  cloudflare: {\n",[465,844,845,848],{"class":467,"line":496},[465,846,847],{"class":475},"    exports: ",[465,849,850],{"class":482},"\"custom-exports-entry.ts\"\n",[465,852,853],{"class":467,"line":512},[465,854,796],{"class":475},[465,856,857],{"class":467,"line":524},[465,858,571],{"class":475},[615,860,862],{"id":861},"scheduled-tasks-cron-triggers","Scheduled Tasks (Cron Triggers)",[405,864,865,866,869,870,873,874,879],{},"When using ",[427,867,868],{"href":59},"Nitro tasks"," with ",[413,871,872],{},"scheduledTasks",", Nitro automatically generates ",[427,875,878],{"href":876,"rel":877},"https://developers.cloudflare.com/workers/configuration/cron-triggers/",[436],"Cron Triggers"," in the wrangler config at build time.",[457,881,883],{"className":459,"code":882,"filename":454,"language":461,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\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,884,885,897,901,911,920,925,934,939,944,958,970,975,980,990,995],{"__ignoreMap":5},[465,886,887,889,891,893,895],{"class":467,"line":468},[465,888,472],{"class":471},[465,890,476],{"class":475},[465,892,479],{"class":471},[465,894,483],{"class":482},[465,896,486],{"class":475},[465,898,899],{"class":467,"line":489},[465,900,493],{"emptyLinePlaceholder":492},[465,902,903,905,907,909],{"class":467,"line":496},[465,904,499],{"class":471},[465,906,502],{"class":471},[465,908,506],{"class":505},[465,910,509],{"class":475},[465,912,913,916,918],{"class":467,"line":512},[465,914,915],{"class":475},"  preset: ",[465,917,530],{"class":482},[465,919,521],{"class":475},[465,921,922],{"class":467,"line":524},[465,923,924],{"class":475},"  experimental: {\n",[465,926,927,930,932],{"class":467,"line":535},[465,928,929],{"class":475},"    tasks: ",[465,931,548],{"class":547},[465,933,521],{"class":475},[465,935,936],{"class":467,"line":541},[465,937,938],{"class":475},"  },\n",[465,940,941],{"class":467,"line":553},[465,942,943],{"class":475},"  scheduledTasks: {\n",[465,945,946,949,952,955],{"class":467,"line":562},[465,947,948],{"class":482},"    \"* * * * *\"",[465,950,951],{"class":475},": [",[465,953,954],{"class":482},"\"cms:update\"",[465,956,957],{"class":475},"],\n",[465,959,960,963,965,968],{"class":467,"line":568},[465,961,962],{"class":482},"    \"0 15 1 * *\"",[465,964,951],{"class":475},[465,966,967],{"class":482},"\"db:cleanup\"",[465,969,957],{"class":475},[465,971,973],{"class":467,"line":972},11,[465,974,938],{"class":475},[465,976,978],{"class":467,"line":977},12,[465,979,842],{"class":475},[465,981,983,986,988],{"class":467,"line":982},13,[465,984,985],{"class":475},"    deployConfig: ",[465,987,548],{"class":547},[465,989,521],{"class":475},[465,991,993],{"class":467,"line":992},14,[465,994,938],{"class":475},[465,996,998],{"class":467,"line":997},15,[465,999,571],{"class":475},[405,1001,1002],{},"No manual Wrangler configuration is needed - Nitro handles it for you.",[400,1004,1006],{"id":1005},"cloudflare-pages","Cloudflare Pages",[405,1008,1009,411,1011],{},[408,1010,410],{},[413,1012,1013],{},"cloudflare_pages",[417,1015],{"to":1016,"title":1006},"https://pages.cloudflare.com/",[421,1018,1019],{},[405,1020,425,1021,438],{},[427,1022,430],{"href":429},[806,1024,1025],{},[405,1026,1027,1028,1032],{},"Cloudflare ",[427,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.",[405,1034,451,1035,1037],{},[413,1036,454],{}," file for deploying a Nitro app to Cloudflare Pages.",[457,1039,1041],{"className":459,"code":1040,"filename":454,"language":461,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n    preset: \"cloudflare_pages\",\n    cloudflare: {\n      deployConfig: true,\n      nodeCompat:true\n    }\n})\n",[413,1042,1043,1055,1059,1069,1078,1082,1090,1097,1101],{"__ignoreMap":5},[465,1044,1045,1047,1049,1051,1053],{"class":467,"line":468},[465,1046,472],{"class":471},[465,1048,476],{"class":475},[465,1050,479],{"class":471},[465,1052,483],{"class":482},[465,1054,486],{"class":475},[465,1056,1057],{"class":467,"line":489},[465,1058,493],{"emptyLinePlaceholder":492},[465,1060,1061,1063,1065,1067],{"class":467,"line":496},[465,1062,499],{"class":471},[465,1064,502],{"class":471},[465,1066,506],{"class":505},[465,1068,509],{"class":475},[465,1070,1071,1073,1076],{"class":467,"line":512},[465,1072,527],{"class":475},[465,1074,1075],{"class":482},"\"cloudflare_pages\"",[465,1077,521],{"class":475},[465,1079,1080],{"class":467,"line":524},[465,1081,538],{"class":475},[465,1083,1084,1086,1088],{"class":467,"line":535},[465,1085,544],{"class":475},[465,1087,548],{"class":547},[465,1089,521],{"class":475},[465,1091,1092,1095],{"class":467,"line":541},[465,1093,1094],{"class":475},"      nodeCompat:",[465,1096,559],{"class":547},[465,1098,1099],{"class":467,"line":553},[465,1100,565],{"class":475},[465,1102,1103],{"class":467,"line":562},[465,1104,571],{"class":475},[405,1106,1107,1108,1111,1112,1115,1116,1121],{},"Nitro automatically generates a ",[413,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 ",[413,1113,1114],{},"cloudflare.pages.routes"," (",[427,1117,1120],{"href":1118,"rel":1119},"https://developers.cloudflare.com/pages/platform/functions/routing/#functions-invocation-routes",[436],"read more",").",[615,1123,618],{"id":1124},"local-preview-1",[405,1126,621,1127,627],{},[427,1128,626],{"href":624,"rel":1129},[436],[629,1131],{"script":631},[633,1133],{"command":1134},"wrangler pages dev",[615,1136,639],{"id":1137},"manual-deploy-1",[405,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:",[633,1142],{"command":648},[405,1144,651],{},[633,1146],{"command":1147},"wrangler pages deploy",[400,1149,1151],{"id":1150},"deploy-within-cicd-using-github-actions","Deploy within CI/CD using GitHub Actions",[405,1153,1154,1155,1160],{},"Regardless on whether you're using Cloudflare Pages or Cloudflare Workers, you can use the ",[427,1156,1159],{"href":1157,"rel":1158},"https://github.com/marketplace/actions/deploy-to-cloudflare-workers-with-wrangler",[436],"Wrangler GitHub actions"," to deploy your application.",[421,1162,1163],{},[405,1164,1165,1168,1169,1173,1174,1176],{},[408,1166,1167],{},"Note:"," Remember to ",[427,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 ",[413,1175,1013],{}," one).",[400,1178,1180],{"id":1179},"environment-variables","Environment Variables",[405,1182,1183,1184,1187,1188,1191],{},"Nitro allows you to universally access environment variables using ",[413,1185,1186],{},"process.env"," or ",[413,1189,1190],{},"import.meta.env"," or the runtime config.",[421,1193,1194],{},[405,1195,1196,1197,1200],{},"Make sure to only access environment variables ",[408,1198,1199],{},"within the event lifecycle","  and not in global contexts since Cloudflare only makes them available during the request lifecycle and not before.",[405,1202,1203,1206,1207,1210,1211,1214],{},[408,1204,1205],{},"Example:"," If you have set the ",[413,1208,1209],{},"SECRET"," and ",[413,1212,1213],{},"NITRO_HELLO_THERE"," environment variables set you can access them in the following way:",[457,1216,1218],{"className":459,"code":1217,"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,1219,1220,1233,1247,1251,1270,1274,1295,1300,1308,1315,1323,1339],{"__ignoreMap":5},[465,1221,1222,1224,1227,1229,1231],{"class":467,"line":468},[465,1223,472],{"class":471},[465,1225,1226],{"class":475}," { defineHandler } ",[465,1228,479],{"class":471},[465,1230,483],{"class":482},[465,1232,486],{"class":475},[465,1234,1235,1237,1240,1242,1245],{"class":467,"line":489},[465,1236,472],{"class":471},[465,1238,1239],{"class":475}," { useRuntimeConfig } ",[465,1241,479],{"class":471},[465,1243,1244],{"class":482}," \"nitro/runtime-config\"",[465,1246,486],{"class":475},[465,1248,1249],{"class":467,"line":496},[465,1250,493],{"emptyLinePlaceholder":492},[465,1252,1253,1256,1259,1262,1264,1267],{"class":467,"line":512},[465,1254,1255],{"class":475},"console.",[465,1257,1258],{"class":505},"log",[465,1260,1261],{"class":475},"(process.env.",[465,1263,1209],{"class":547},[465,1265,1266],{"class":475},") ",[465,1268,1269],{"class":790},"// note that this is in the global scope! so it doesn't actually work and the variable is undefined!\n",[465,1271,1272],{"class":467,"line":524},[465,1273,493],{"emptyLinePlaceholder":492},[465,1275,1276,1278,1280,1283,1286,1288,1290,1293],{"class":467,"line":535},[465,1277,499],{"class":471},[465,1279,502],{"class":471},[465,1281,1282],{"class":505}," defineHandler",[465,1284,1285],{"class":475},"((",[465,1287,765],{"class":764},[465,1289,1266],{"class":475},[465,1291,1292],{"class":471},"=>",[465,1294,750],{"class":475},[465,1296,1297],{"class":467,"line":541},[465,1298,1299],{"class":790},"  // note that all the below are valid ways of accessing the above mentioned variables\n",[465,1301,1302,1305],{"class":467,"line":553},[465,1303,1304],{"class":505},"  useRuntimeConfig",[465,1306,1307],{"class":475},"().helloThere\n",[465,1309,1310,1312],{"class":467,"line":562},[465,1311,1304],{"class":505},[465,1313,1314],{"class":475},"().secret\n",[465,1316,1317,1320],{"class":467,"line":568},[465,1318,1319],{"class":475},"  process.env.",[465,1321,1322],{"class":547},"NITRO_HELLO_THERE\n",[465,1324,1325,1328,1330,1333,1336],{"class":467,"line":972},[465,1326,1327],{"class":471},"  import",[465,1329,438],{"class":475},[465,1331,1332],{"class":547},"meta",[465,1334,1335],{"class":475},".env.",[465,1337,1338],{"class":547},"SECRET\n",[465,1340,1341],{"class":467,"line":977},[465,1342,1343],{"class":475},"});\n",[615,1345,1347],{"id":1346},"specify-variables-in-development-mode","Specify Variables in Development Mode",[405,1349,1350,1351,1187,1354,1357],{},"For development, you can use a ",[413,1352,1353],{},".env",[413,1355,1356],{},".env.local"," file to specify environment variables:",[457,1359,1363],{"className":1360,"code":1361,"language":1362,"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,1364,1365,1375],{"__ignoreMap":5},[465,1366,1367,1369,1372],{"class":467,"line":468},[465,1368,1213],{"class":471},[465,1370,1371],{"class":475},"=",[465,1373,1374],{"class":482},"\"captain\"\n",[465,1376,1377,1379,1381],{"class":467,"line":489},[465,1378,1209],{"class":471},[465,1380,1371],{"class":475},[465,1382,1383],{"class":482},"\"top-secret\"\n",[421,1385,1386],{},[405,1387,1388,1390,1391,1210,1393,1395,1396,1399],{},[408,1389,1167],{}," Make sure you add ",[413,1392,1353],{},[413,1394,1356],{}," to the ",[413,1397,1398],{},".gitignore"," file so that you don't commit it as it can contain sensitive information.",[615,1401,1403],{"id":1402},"specify-variables-for-local-previews","Specify Variables for local previews",[405,1405,1406,1407,1187,1409,1411,1412,1415,1416,1210,1421,1426],{},"After build, when you try out your project locally with ",[413,1408,635],{},[413,1410,1134],{},", in order to have access to environment variables you will need to specify the in a ",[413,1413,1414],{},".dev.vars"," file in the root of your project (as presented in the ",[427,1417,1420],{"href":1418,"rel":1419},"https://developers.cloudflare.com/pages/functions/bindings/#interact-with-your-environment-variables-locally",[436],"Pages",[427,1422,1425],{"href":1423,"rel":1424},"https://developers.cloudflare.com/workers/configuration/environment-variables/#interact-with-environment-variables-locally",[436],"Workers"," documentation).",[405,1428,1429,1430,1187,1432,1434,1435,1437],{},"If you are using a ",[413,1431,1353],{},[413,1433,1356],{}," file while developing, your ",[413,1436,1414],{}," should be identical to it.",[421,1439,1440],{},[405,1441,1442,1390,1444,1395,1446,1399],{},[408,1443,1167],{},[413,1445,1414],{},[413,1447,1398],{},[615,1449,1451],{"id":1450},"specify-variables-for-production","Specify Variables for Production",[405,1453,1454,1455,1462],{},"For production, use the Cloudflare dashboard or the ",[427,1456,1459],{"href":1457,"rel":1458},"https://developers.cloudflare.com/workers/wrangler/commands/#secret",[436],[413,1460,1461],{},"wrangler secret"," command to set environment variables and secrets.",[615,1464,1466,1467,392,1470],{"id":1465},"specify-variables-using-wranglertomlwranglerjson","Specify Variables using ",[413,1468,1469],{},"wrangler.toml",[413,1471,581],{},[405,1473,1474,1475,392,1477,1479],{},"You can specify a custom ",[413,1476,1469],{},[413,1478,581],{}," file and define vars inside.",[806,1481,1482],{},[405,1483,1484],{},"Note that this isn't recommended for sensitive data like secrets.",[405,1486,1487],{},[408,1488,1205],{},[1490,1491,1492,1555],"code-group",{},[457,1493,1495],{"className":1360,"code":1494,"filename":1469,"language":1362,"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,1496,1497,1502,1507,1516,1525,1529,1534,1539,1547],{"__ignoreMap":5},[465,1498,1499],{"class":467,"line":468},[465,1500,1501],{"class":790},"# Shared\n",[465,1503,1504],{"class":467,"line":489},[465,1505,1506],{"class":505},"[vars]\n",[465,1508,1509,1511,1513],{"class":467,"line":496},[465,1510,1213],{"class":471},[465,1512,1371],{"class":475},[465,1514,1515],{"class":482},"\"general\"\n",[465,1517,1518,1520,1522],{"class":467,"line":512},[465,1519,1209],{"class":471},[465,1521,1371],{"class":475},[465,1523,1524],{"class":482},"\"secret\"\n",[465,1526,1527],{"class":467,"line":524},[465,1528,493],{"emptyLinePlaceholder":492},[465,1530,1531],{"class":467,"line":535},[465,1532,1533],{"class":790},"# Override values for `--env production` usage\n",[465,1535,1536],{"class":467,"line":541},[465,1537,1538],{"class":505},"[env.production.vars]\n",[465,1540,1541,1543,1545],{"class":467,"line":553},[465,1542,1213],{"class":471},[465,1544,1371],{"class":475},[465,1546,1374],{"class":482},[465,1548,1549,1551,1553],{"class":467,"line":562},[465,1550,1209],{"class":471},[465,1552,1371],{"class":475},[465,1554,1383],{"class":482},[457,1556,1560],{"className":1557,"code":1558,"filename":581,"language":1559,"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,1561,1562,1567,1575,1588,1597,1601,1608,1615,1622,1634,1643,1648,1652,1656],{"__ignoreMap":5},[465,1563,1564],{"class":467,"line":468},[465,1565,1566],{"class":475},"{\n",[465,1568,1569,1572],{"class":467,"line":489},[465,1570,1571],{"class":547},"  \"vars\"",[465,1573,1574],{"class":475},": {\n",[465,1576,1577,1580,1583,1586],{"class":467,"line":496},[465,1578,1579],{"class":547},"    \"NITRO_HELLO_THERE\"",[465,1581,1582],{"class":475},": ",[465,1584,1585],{"class":482},"\"general\"",[465,1587,521],{"class":475},[465,1589,1590,1593,1595],{"class":467,"line":512},[465,1591,1592],{"class":547},"    \"SECRET\"",[465,1594,1582],{"class":475},[465,1596,1524],{"class":482},[465,1598,1599],{"class":467,"line":524},[465,1600,938],{"class":475},[465,1602,1603,1606],{"class":467,"line":535},[465,1604,1605],{"class":547},"  \"env\"",[465,1607,1574],{"class":475},[465,1609,1610,1613],{"class":467,"line":541},[465,1611,1612],{"class":547},"    \"production\"",[465,1614,1574],{"class":475},[465,1616,1617,1620],{"class":467,"line":553},[465,1618,1619],{"class":547},"      \"vars\"",[465,1621,1574],{"class":475},[465,1623,1624,1627,1629,1632],{"class":467,"line":562},[465,1625,1626],{"class":547},"        \"NITRO_HELLO_THERE\"",[465,1628,1582],{"class":475},[465,1630,1631],{"class":482},"\"captain\"",[465,1633,521],{"class":475},[465,1635,1636,1639,1641],{"class":467,"line":568},[465,1637,1638],{"class":547},"        \"SECRET\"",[465,1640,1582],{"class":475},[465,1642,1383],{"class":482},[465,1644,1645],{"class":467,"line":972},[465,1646,1647],{"class":475},"      }\n",[465,1649,1650],{"class":467,"line":977},[465,1651,565],{"class":475},[465,1653,1654],{"class":467,"line":982},[465,1655,796],{"class":475},[465,1657,1658],{"class":467,"line":992},[465,1659,801],{"class":475},[400,1661,1663],{"id":1662},"direct-access-to-cloudflare-bindings","Direct access to Cloudflare bindings",[405,1665,1666,1667,1672,1673,1121],{},"Bindings are what allows you to interact with resources from the Cloudflare platform, examples of such resources are key-value data storages (",[427,1668,1671],{"href":1669,"rel":1670},"https://developers.cloudflare.com/kv/",[436],"KVs",") and serverless SQL databases (",[427,1674,1677],{"href":1675,"rel":1676},"https://developers.cloudflare.com/d1/",[436],"D1s",[417,1679,1680],{},[405,1681,1682,1683,1210,1687,1691],{},"For more details on Bindings and how to use them please refer to the Cloudflare ",[427,1684,1420],{"href":1685,"rel":1686},"https://developers.cloudflare.com/pages/functions/bindings/",[436],[427,1688,1425],{"href":1689,"rel":1690},"https://developers.cloudflare.com/workers/configuration/bindings/#bindings",[436]," documentation.",[1693,1694,1695],"tip",{},[405,1696,1697,1698,1210,1700,1702],{},"\nNitro provides high level API to interact with primitives such as ",[427,1699,73],{"href":74},[427,1701,38],{"href":39}," and you are highly recommended to prefer using them instead of directly depending on low-level APIs for usage stability.",[417,1704],{"to":39,"title":1705},"Database Layer",[417,1707],{"to":74,"title":73},[405,1709,1710,1711,1714],{},"In runtime, you can access bindings from the request event via ",[413,1712,1713],{},"event.req.runtime.cloudflare.env",". This is for example how you can access a D1 binding:",[457,1716,1718],{"className":459,"code":1717,"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,1719,1720,1732,1736,1756,1775,1807,1831],{"__ignoreMap":5},[465,1721,1722,1724,1726,1728,1730],{"class":467,"line":468},[465,1723,472],{"class":471},[465,1725,1226],{"class":475},[465,1727,479],{"class":471},[465,1729,483],{"class":482},[465,1731,486],{"class":475},[465,1733,1734],{"class":467,"line":489},[465,1735,493],{"emptyLinePlaceholder":492},[465,1737,1738,1741,1743,1746,1748,1750,1752,1754],{"class":467,"line":496},[465,1739,1740],{"class":505},"defineHandler",[465,1742,761],{"class":475},[465,1744,1745],{"class":471},"async",[465,1747,1115],{"class":475},[465,1749,765],{"class":764},[465,1751,1266],{"class":475},[465,1753,1292],{"class":471},[465,1755,750],{"class":475},[465,1757,1758,1761,1764,1767,1770,1772],{"class":467,"line":512},[465,1759,1760],{"class":471},"  const",[465,1762,1763],{"class":475}," { ",[465,1765,1766],{"class":547},"env",[465,1768,1769],{"class":475}," } ",[465,1771,1371],{"class":471},[465,1773,1774],{"class":475}," event.req.runtime.cloudflare\n",[465,1776,1777,1779,1782,1785,1788,1791,1794,1796,1799,1801,1804],{"class":467,"line":524},[465,1778,1760],{"class":471},[465,1780,1781],{"class":547}," stmt",[465,1783,1784],{"class":471}," =",[465,1786,1787],{"class":471}," await",[465,1789,1790],{"class":475}," env.",[465,1792,1793],{"class":547},"MY_D1",[465,1795,438],{"class":475},[465,1797,1798],{"class":505},"prepare",[465,1800,761],{"class":475},[465,1802,1803],{"class":482},"'SELECT id FROM table'",[465,1805,1806],{"class":475},")\n",[465,1808,1809,1811,1813,1816,1818,1820,1822,1825,1828],{"class":467,"line":535},[465,1810,1760],{"class":471},[465,1812,1763],{"class":475},[465,1814,1815],{"class":547},"results",[465,1817,1769],{"class":475},[465,1819,1371],{"class":471},[465,1821,1787],{"class":471},[465,1823,1824],{"class":475}," stmt.",[465,1826,1827],{"class":505},"all",[465,1829,1830],{"class":475},"()\n",[465,1832,1833],{"class":467,"line":541},[465,1834,571],{"class":475},[615,1836,1838],{"id":1837},"access-to-the-bindings-in-local-dev","Access to the bindings in local dev",[405,1840,1841,1842,392,1845,392,1847,1849],{},"To access bindings in dev mode, we first define them. You can do this in a ",[413,1843,1844],{},"wrangler.jsonc",[413,1846,581],{},[413,1848,1469],{}," file",[405,1851,1852,1853,768],{},"For example, to define a variable and a KV namespace in ",[413,1854,1469],{},[1490,1856,1857,1909],{},[457,1858,1860],{"className":1360,"code":1859,"filename":1469,"language":1362,"meta":5,"style":5},"[vars]\nMY_VARIABLE=\"my-value\"\n\n[[kv_namespaces]]\nbinding = \"MY_KV\"\nid = \"xxx\"\n",[413,1861,1862,1866,1876,1880,1888,1899],{"__ignoreMap":5},[465,1863,1864],{"class":467,"line":468},[465,1865,1506],{"class":505},[465,1867,1868,1871,1873],{"class":467,"line":489},[465,1869,1870],{"class":471},"MY_VARIABLE",[465,1872,1371],{"class":475},[465,1874,1875],{"class":482},"\"my-value\"\n",[465,1877,1878],{"class":467,"line":496},[465,1879,493],{"emptyLinePlaceholder":492},[465,1881,1882,1885],{"class":467,"line":512},[465,1883,1884],{"class":505},"[[kv_namespaces]",[465,1886,1887],{"class":475},"]\n",[465,1889,1890,1893,1896],{"class":467,"line":524},[465,1891,1892],{"class":471},"binding",[465,1894,1895],{"class":475}," = ",[465,1897,1898],{"class":482},"\"MY_KV\"\n",[465,1900,1901,1904,1906],{"class":467,"line":535},[465,1902,1903],{"class":471},"id",[465,1905,1895],{"class":475},[465,1907,1908],{"class":482},"\"xxx\"\n",[457,1910,1912],{"className":1557,"code":1911,"filename":581,"language":1559,"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,1913,1914,1918,1924,1936,1940,1948,1953,1965,1974,1978,1983],{"__ignoreMap":5},[465,1915,1916],{"class":467,"line":468},[465,1917,1566],{"class":475},[465,1919,1920,1922],{"class":467,"line":489},[465,1921,1571],{"class":547},[465,1923,1574],{"class":475},[465,1925,1926,1929,1931,1934],{"class":467,"line":496},[465,1927,1928],{"class":547},"    \"MY_VARIABLE\"",[465,1930,1582],{"class":475},[465,1932,1933],{"class":482},"\"my-value\"",[465,1935,521],{"class":475},[465,1937,1938],{"class":467,"line":512},[465,1939,938],{"class":475},[465,1941,1942,1945],{"class":467,"line":524},[465,1943,1944],{"class":547},"  \"kv_namespaces\"",[465,1946,1947],{"class":475},": [\n",[465,1949,1950],{"class":467,"line":535},[465,1951,1952],{"class":475},"    {\n",[465,1954,1955,1958,1960,1963],{"class":467,"line":541},[465,1956,1957],{"class":547},"      \"binding\"",[465,1959,1582],{"class":475},[465,1961,1962],{"class":482},"\"MY_KV\"",[465,1964,521],{"class":475},[465,1966,1967,1970,1972],{"class":467,"line":553},[465,1968,1969],{"class":547},"      \"id\"",[465,1971,1582],{"class":475},[465,1973,1908],{"class":482},[465,1975,1976],{"class":467,"line":562},[465,1977,565],{"class":475},[465,1979,1980],{"class":467,"line":568},[465,1981,1982],{"class":475},"  ]\n",[465,1984,1985],{"class":467,"line":972},[465,1986,801],{"class":475},[405,1988,1989,1990,1993],{},"Next we install the required ",[413,1991,1992],{},"wrangler"," package (if not already installed):",[1995,1996],"pm-install",{"name":1997},"wrangler -D",[405,1999,2000],{},"From this moment, when running",[629,2002],{"script":2003},"dev",[405,2005,2006,2007,1210,2009,2012],{},"you will be able to access the ",[413,2008,1870],{},[413,2010,2011],{},"MY_KV"," from the request event just as illustrated above.",[2014,2015,2017],"h4",{"id":2016},"wrangler-environments","Wrangler environments",[405,2019,2020],{},"If you have multiple Wrangler environments, you can specify which Wrangler environment to use during Cloudflare dev emulation:",[457,2022,2024],{"className":459,"code":2023,"filename":454,"language":461,"meta":5,"style":5},"import { defineConfig } from \"nitro\";\n\nexport default defineConfig({\n  preset: 'cloudflare_module',\n  cloudflare: {\n    dev: {\n      environment: 'preview'\n    }\n  }\n})\n",[413,2025,2026,2038,2042,2052,2061,2065,2070,2078,2082,2086],{"__ignoreMap":5},[465,2027,2028,2030,2032,2034,2036],{"class":467,"line":468},[465,2029,472],{"class":471},[465,2031,476],{"class":475},[465,2033,479],{"class":471},[465,2035,483],{"class":482},[465,2037,486],{"class":475},[465,2039,2040],{"class":467,"line":489},[465,2041,493],{"emptyLinePlaceholder":492},[465,2043,2044,2046,2048,2050],{"class":467,"line":496},[465,2045,499],{"class":471},[465,2047,502],{"class":471},[465,2049,506],{"class":505},[465,2051,509],{"class":475},[465,2053,2054,2056,2059],{"class":467,"line":512},[465,2055,915],{"class":475},[465,2057,2058],{"class":482},"'cloudflare_module'",[465,2060,521],{"class":475},[465,2062,2063],{"class":467,"line":524},[465,2064,842],{"class":475},[465,2066,2067],{"class":467,"line":535},[465,2068,2069],{"class":475},"    dev: {\n",[465,2071,2072,2075],{"class":467,"line":541},[465,2073,2074],{"class":475},"      environment: ",[465,2076,2077],{"class":482},"'preview'\n",[465,2079,2080],{"class":467,"line":553},[465,2081,565],{"class":475},[465,2083,2084],{"class":467,"line":562},[465,2085,796],{"class":475},[465,2087,2088],{"class":467,"line":568},[465,2089,571],{"class":475},[2091,2092,2093],"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":2095},[2096,2103,2107,2108,2115],{"id":402,"depth":489,"text":403,"children":2097},[2098,2099,2100,2101,2102],{"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":861,"depth":496,"text":862},{"id":1005,"depth":489,"text":1006,"children":2104},[2105,2106],{"id":1124,"depth":496,"text":618},{"id":1137,"depth":496,"text":639},{"id":1150,"depth":489,"text":1151},{"id":1179,"depth":489,"text":1180,"children":2109},[2110,2111,2112,2113],{"id":1346,"depth":496,"text":1347},{"id":1402,"depth":496,"text":1403},{"id":1450,"depth":496,"text":1451},{"id":1465,"depth":496,"text":2114},"Specify Variables using wrangler.toml/wrangler.json",{"id":1662,"depth":489,"text":1663,"children":2116},[2117],{"id":1837,"depth":496,"text":1838},"Deploy Nitro apps to Cloudflare.","md",{},{},{"title":142,"description":2118},"lC_SHddFlsI6mdOByqvaxaLQzQWBK7wMuxu1e4_uSps",[2125,2127],{"title":138,"path":139,"stem":140,"description":2126,"children":-1},"Deploy Nitro apps to Cleavr.",{"title":146,"path":147,"stem":148,"description":2128,"children":-1},"Deploy Nitro apps to Deno Deploy.",1776075615214]