Thanks for your interest in improving Startup API! This guide is for developers working on the framework itself (the @startup-api/cloudflare package in this repository).
Building an application on top of Startup API? You don't need to clone this repo — scaffold a project with
npm create startup-apiinstead. See the README.
- Node.js 20 or newer (and npm)
- A Cloudflare account if you want to deploy a test worker
git clone https://github.com/StartupAPI/startup-api-cloudflare.git
cd startup-api-cloudflare
npm installnpm run dev # start the worker locally (uses wrangler.local.jsonc)This serves the worker at http://localhost:8787. Local configuration and secrets live in wrangler.local.jsonc and .dev.vars — never commit changes to .env or .dev.vars.
To deploy your own test worker to Cloudflare:
npm run deploynpm test # runs eslint then the vitest suite
npm run lint # eslint only
npm run format # prettier --write across the repo- When you add a feature, add tests that cover the new code.
- Run
npm run lintand fix anything it flags before committing. - Run
npm run formatafter changes so the diff stays prettier-clean. - Every time you edit
wrangler.jsonc, runnpm run cf-typegento regenerate the binding types.
- TypeScript strict mode; single quotes and trailing commas (enforced by prettier).
- Internal worker routes are prefixed with the configured
usersPath; non-admin API paths start with/${usersPath}/api/and admin paths with/${usersPath}/admin/api/. - Call Durable Objects via RPC rather than
fetch(), and name stub variables after the DO they refer to.
See AGENTS.md for the full set of repository conventions.
- Create a branch for your change.
- Make sure
npm testpasses and the code is formatted. - Open a Pull Request describing what changed and why.
By contributing, you agree that your contributions are licensed under the Apache License 2.0.