- 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
23 lines
556 B
Bash
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
|