Node and Express API patterns

Compare long-running Node APIs with FastAPI relays and Astro API routes for probe data.

Express (or Fastify) on Node remains a straightforward choice for JSON APIs, webhooks, and cron jobs. A monitoring stack might use Express to poll probes, write Supabase rows, and serve CSV export links.

Common routes

  1. GET /api/feeds/:id — cached probe JSON for dashboards.
  2. POST /webhooks/stripe — unlock CSV subscription features.
  3. GET /export/history.csv — authenticated download.

Operational notes

  • Run behind HTTPS reverse proxy with rate limits.
  • Use connection pooling for Supabase Postgres if querying directly.
  • Prefer idempotent webhooks for Stripe events.

Parallel in Astro

This repo implements similar endpoints as Astro server routes—history inserts and probe fetch.