/workers-typesafe-db-example

An example Cloudflare Worker API with a typesafe database

Primary LanguageTypeScriptMIT LicenseMIT

Cloudflare Worker Typesafe DB Example

An example Cloudflare Worker API with a typesafe database

Stack

Setup

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

Note

Probably not the best setup, but just what works well for me :)