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