1.2 KiB
1.2 KiB
EmDash Cloudflare Demo
This demo shows EmDash running on Cloudflare Workers with D1 database.
Uses Astro 6 + @astrojs/cloudflare v13 which runs the real workerd runtime in development.
Setup
- Create a D1 database:
pnpm db:create
- Copy the database ID from the output and update
wrangler.jsonc:
"d1_databases": [
{
"binding": "DB",
"database_name": "emdash-demo",
"database_id": "YOUR_DATABASE_ID_HERE"
}
]
- Start the dev server:
pnpm dev
EmDash runs migrations automatically on first request — no manual migration step needed.
Preview
After building, you can preview with the real Workers runtime:
pnpm build
pnpm preview
Deployment
pnpm deploy
This builds and deploys to Cloudflare Workers. EmDash handles migrations automatically on startup.
Notes
astro devnow usesworkerd(the real Workers runtime) - development matches productionwrangler typesruns automatically before dev/build to generate TypeScript types for bindings- No
platformProxyconfig needed - Astro 6 handles this automatically
TODO
- R2 storage for media uploads
- Auth integration (Cloudflare Access or custom)