This is an example application of using D1 in Cloudflare Pages.
- Fork this repository
- Create a D1 database with
npx wrangler d1 create message-board
- Run the migrations with
npx wrangler d1 migrations apply message-board
- Go to the Cloudflare dashboard and create a Pages project pointing to the repository - https://dash.cloudflare.com?to=/:account/pages/new
- Head over to "Settings" -> "Functions" and bind your D1 database to
DB
- Trigger a new deployment and enjoy the demo!