MaryHal / solid-start-cloudflare-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Solid-start-cloudflare-example

This example uses Cloudflare D1 and deploys to Cloudflare Workers

Cloudflare bindings in wrangler.toml are mapped in src/env/cloudflare.ts and imported in src/root.tsx.

Local Run

Prepare local sqlite database

rm .mf/d1/db.sqlite3
touch .mf/d1/db.sqlite3
sqlite3 .mf/d1/db.sqlite3 < migrations/**.sql

Run

pnpm run dev

Publish your worker

Create the D1 database and update wrangler.toml

Note that miniflare's D1 support is still in beta, so the binding name needs to be prefixed with __D1_BETA__ when running this application locally.

pnpm exec wrangler d1 create solid-start-cloudflare-example-db

Run migrations

pnpm exec wrangler d1 migrations apply solid-start-cloudflare-example-db

Publish

pnpm run publish

About


Languages

Language:TypeScript 100.0%