trends.stumason.dev
TypeScript
Pull Request Opened
PR #13 opened: feat: add REST API for trends data
Summary
- Add TrendsController with
/api/v1/trends,/api/v1/stats,/api/v1/sourcesendpoints - Add VerifyApiKey middleware for bearer token authentication
- Support for filtering by period (24h/7d/30d) and source prefix
Endpoints
GET /api/v1/stats- Total items, last 24h/7d counts, top sourcesGET /api/v1/trends?period=24h&source=hn&limit=20- Recent items with optional filtersGET /api/v1/sources- List of active sources
Test plan
- Tested locally with curl
- Deploy and test with API_KEY env var set
+886
additions
-0
deletions
8
files changed