Node and Express API patterns

Compare long-running Node/Express APIs with FastAPI relays and Astro edge routes for probe ingest and dashboard data.

Close-up of white Cat-5e Ethernet cables with RJ45 connectors
Probe JSON usually leaves the LAN over Ethernet or a nearby relay, not the public internet directly. Photo: DiscDepotDundee.co.uk. CC BY-SA 4.0

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.

FAQ

Does ProbeHarbor run Express?
No. Public APIs and pages run on Cloudflare Workers with Astro routes. Express is discussed here for comparison with long-running Node APIs.

Where is the HTTP API?
probeharbor.dev/docs/api and openapi.yaml — ingest, metrics, webhooks, and claim-puck endpoints.