58 Svelte components for apps and AI interfaces. Set colors, fonts, radius, and motion in one theme. Install with the CLI, or point your coding agent at the docs.
Add per-key rate limits to the public API. 100 requests a minute, and return a proper 429 when a client goes over.
Searched twice, read 3 files1.9s
Every request passes through authenticate, so the limiter sits right after it and keys on the API key. It uses a sliding window in Redis, so a client cannot burst across a minute boundary.
src/app.ts+3−1
99 .use(authenticate)
10+ .use(rateLimit({ limit: 100, window: "1m" }))
10− .route("/v1", routes);
11+ .route("/v1", routes)
12+ .onError(rateLimitErrors);
Created 2 files, ran 1 command3.2s
Each API key now gets 100 requests per minute. Over the limit, the API returns 429 and tells the client when to retry.
bun test api passes, including 4 new limiter tests.