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