Framework dev servers gain access to Cloudflare's platform resources
Cloudflare's framework integrations now let full-stack apps reach platform services such as D1, R2 and AI models without abandoning the framework's own dev server. Supporting Astro, Next.js, Nuxt, Qwik, Remix, SolidStart and SvelteKit, the change targets a tradeoff developers previously had to accept in local development.
The old tradeoff
Running an app with D1 locally used to mean building for production and starting it with wrangler pages dev. Iterations took seconds — tens of seconds for large apps — pulling developers out of flow and discarding the DX optimizations framework authors built into their tooling.
Framework dev servers are tailored to their framework and offer strong development experiences, but they don't natively support Cloudflare's storage solutions. The alternative — using Cloudflare resources through bindings — required giving up framework-specific tooling, slowing the loop from milliseconds to seconds.
Scaffolding a local-first app
Applications start with C3, Cloudflare's create-cloudflare CLI:
$ npm create cloudflare@latest
After naming the app, pick "Website or web app" and choose a framework. C3 delegates scaffolding to the latest framework-specific CLI, so you get the app exactly as the framework authors intended. C3 then adds everything needed for Cloudflare integration and deployment.
Adding a database
Bound resources can now be configured in wrangler.toml, including for full-stack apps deployed to Pages. Once the D1 configuration is in place and a schema.sql describing the schema exists, initialize the local database:
$ npx wrangler d1 execute blog-products-db --local --file schema.sql
The --local flag of wrangler d1 execute applies changes to the local D1 database, which is the one the dev server connects to. TypeScript users can then run:
$ npm run build-cf-types
This shortcut, preconfigured in all C3-created full-stack apps, runs wrangler types to update the environment interface with all configured bindings.
Running and querying
npm run dev starts the framework's dev server — powered by next dev, nitro or vite — and data access then follows framework conventions. In a Next.js app using the App router, that means updating app/api/hello/route.ts; in Nuxt, creating server/api/hello.ts. With the dev server on port 3000, the route is testable at http://localhost:3000/api/hello. The same approach works for UI-generating routes, not just API routes.
Because each framework defines routes and passes request context its own way, resource access differs per framework. Cloudflare publishes updated full-stack guides for Astro, Next.js, Nuxt, Qwik, Remix, SolidStart and SvelteKit. Everything else about the framework stays the same: hot module replacement, custom dev tools and enhanced debugging remain available alongside Cloudflare APIs.
How the runtime bridge works
Miniflare, Cloudflare's local simulator for platform resources, runs on workerd, a JavaScript runtime, so Cloudflare APIs behave locally much like production. But framework dev servers run on Node.js, and introducing a second runtime breaks their assumptions.
The bridge is the getPlatformProxy() API in wrangler, super-powered by miniflare's magic proxy. It exposes a JS proxy object that behaves like the Workers env object containing all bound resources, letting Node.js code transparently invoke JavaScript in workerd and access Cloudflare-specific runtime APIs. Applications in a Node.js-powered dev server can therefore use the D1, R2, KV and other storage simulators; a plain Node.js script can do the same. With that API in place, the remaining work was updating framework adapters, plugins and, in some cases, the frameworks themselves. Cloudflare credits collaborators from Astro, Nuxt, Remix, Solid, Svelte and the next-on-pages project.
Toward workerd in the dev server via Vite
getPlatformProxy() covers many scenarios, but running the whole application in workerd would simulate production more faithfully and reduce friction and production surprises. Ideally, developers would work against the same runtime they deploy to, which requires integrating workerd into every framework's dev server — a substantial effort given how many frameworks exist and how they differ.
Vite's growing adoption offers a shortcut. Remix recently switched to Vite, confirming its role as a common foundation. First-class Vite support for running a full-stack application in an alternative JavaScript runtime would give anyone using Vite complete local access to the platform, with no framework-specific integrations or workarounds.
To that end, Cloudflare is working with the Vite team on the Vite environments proposal. The proposal is still evolving, and further updates are expected.



