Stu Mason
Stu Mason

Activity

Pull Request Merged

PR #13 merged: feat: add REST API for trends data

Summary

  • Add TrendsController with /api/v1/trends, /api/v1/stats, /api/v1/sources endpoints
  • 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 sources
  • GET /api/v1/trends?period=24h&source=hn&limit=20 - Recent items with optional filters
  • GET /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