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