Files
news-platform/bridge/.env.example
T
Artur MoreiraandPaperclip b2034f2497 feat(bridge): implement Fastify bridge API for WordPress (BIT-350)
- Fastify + TypeScript service in bridge/ listening on port 3200
- WordPress REST API client with _embed support and data normalization
- Redis stale-while-revalidate cache with in-process Map fallback
- Domain routing: reads config/domains/<host>.json per Host header
- Routes: /homepage, /articles, /articles/:slug, /articles/:slug/related,
  /categories, /categories/:slug, /trending, /api/tags, /api/media/:id,
  /api/site-config, /health
- /api/posts and /api/categories aliases redirect to canonical routes
- Rate limiting via @fastify/rate-limit; CORS via @fastify/cors
- Error handling: WP unavailable → serve stale cache or 503
- Domain configs for localhost and newsproject.bitreport.pt

Co-Authored-By: Paperclip <[email protected]>
Made-with: Cursor
2026-03-23 14:17:37 +00:00

23 lines
556 B
Bash

# Bridge server port (default: 3200)
PORT=3200
# Host/domain used when no Host header is present (dev fallback)
DEFAULT_HOST=localhost
# Absolute path to config/domains/ directory
DOMAINS_CONFIG_PATH=../config/domains
# Redis connection URL (optional; if unset, in-process Map cache is used)
REDIS_URL=redis://127.0.0.1:6379
# Cache TTLs (seconds)
CACHE_FRESH_TTL=60
CACHE_STALE_TTL=300
# Rate limit: max requests per window per IP
RATE_LIMIT_MAX=100
RATE_LIMIT_WINDOW_MS=60000
# Log level: fatal | error | warn | info | debug | trace
LOG_LEVEL=info