An example Cloudflare Worker API with a typesafe database
- Cloudflare Workers (serverless)
- Hono (router)
- Kysely (typesafe orm)
- D1 (database)
Create your database with Wrangler or through the Dashboard
Set your new database_name
and database_id
in wrangler.toml
(reference)
Run the database migration
npm run migrate
Run locally
npm run dev
Probably not the best setup, but just what works well for me :)