- 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
25 lines
563 B
JSON
25 lines
563 B
JSON
{
|
|
"name": "news-bridge",
|
|
"version": "1.0.0",
|
|
"description": "WordPress REST API bridge for the news platform",
|
|
"type": "module",
|
|
"main": "dist/server.js",
|
|
"scripts": {
|
|
"dev": "tsx watch src/server.ts",
|
|
"build": "tsc",
|
|
"start": "node dist/server.js",
|
|
"typecheck": "tsc --noEmit"
|
|
},
|
|
"dependencies": {
|
|
"@fastify/cors": "^9.0.1",
|
|
"@fastify/rate-limit": "^9.1.0",
|
|
"fastify": "^4.28.1",
|
|
"ioredis": "^5.4.1"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^20.14.0",
|
|
"tsx": "^4.15.0",
|
|
"typescript": "^5.4.5"
|
|
}
|
|
}
|