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