-
Notifications
You must be signed in to change notification settings - Fork 0
Running Locally
Prerequisites: Node.js 20+, npm 10+
Install
cd workers/ingest
npm installApply migrations locally
wrangler d1 migrations apply watchtower --localStart dev server
npm run devKeeps running in a separate terminal when smoke testing.
Run tests
npm testLint
npm run lintSmoke test (requires dev server running)
./scripts/smoke.shTargets http://localhost:8787 by default. To test a deployed instance:
BASE_URL=https://your-worker.workers.dev ./scripts/smoke.shSecrets / env vars
Non-sensitive vars go in wrangler.jsonc under vars. For secrets, create a gitignored .dev.vars file:
Prerequisites: Node.js 20+, npm 10+, Python 3 (for JSON pretty-printing), ingest worker running on :8787
Install
cd workers/api
npm installApply migrations locally
wrangler d1 migrations apply watchtower --localStart dev server
npm run dev -- --port 8788Runs at http://localhost:8788. Keep this running in a separate terminal when smoke testing.
Run tests
npm testLint
npm run lintSmoke test (requires both workers running)
./scripts/smoke.shRequires the ingest worker on :8787 and the API worker on :8788. Defaults to the seeded demo project and user. Override with env vars:
INGEST_URL=https://ingest.example.workers.dev/ingest \
API_BASE=https://api.example.workers.dev \
PROJECT=wt_demo \
EMAIL=demo@watchtower.dev \
PASSWORD=demo1234 \
./scripts/smoke.shSecrets / env vars
Non-sensitive vars go in wrangler.toml under vars. For secrets, create a gitignored .dev.vars file:
SESSION_SECRET=anything
Wrangler loads it automatically on npm run dev.