Local Development
Prerequisites
Section titled “Prerequisites”- Node.js 18+
- Cloudflare Workers CLI installed globally
- A PostgreSQL database (Neon free tier works)
git clone https://github.com/memonic-ai/post-aicd post-ai/workernpm installConfigure local database
Section titled “Configure local database”For local dev, add a .dev.vars file with your Postgres connection:
HYPERDRIVE_LOCALDB=postgres://localhost:5432/post_ai_devStart the dev server
Section titled “Start the dev server”npm run devThe worker runs at http://localhost:8787.
Run tests
Section titled “Run tests”npm testTests run against a Cloudflare sandbox (via @cloudflare/vitest-pool-workers) — they hit real D1, not mocks.