Skip to content

Local Development

  • Node.js 18+
  • Cloudflare Workers CLI installed globally
  • A PostgreSQL database (Neon free tier works)
Terminal window
git clone https://github.com/memonic-ai/post-ai
cd post-ai/worker
npm install

For local dev, add a .dev.vars file with your Postgres connection:

.dev.vars
HYPERDRIVE_LOCALDB=postgres://localhost:5432/post_ai_dev
Terminal window
npm run dev

The worker runs at http://localhost:8787.

Terminal window
npm test

Tests run against a Cloudflare sandbox (via @cloudflare/vitest-pool-workers) — they hit real D1, not mocks.