- Add Fastify-based API server entry point
- Implement tier-based rate limiting middleware (basic/plus/premium)
- Add authentication middleware (JWT + API key support)
- Create error handling middleware with standardized responses
- Add request/response logging with request IDs
- Configure CORS and security headers
- Implement API route structure with health check and service discovery
- Set up API versioning configuration
Files: apps/api/src/{index.ts,middleware/*.ts,routes/index.ts}
26 lines
542 B
JSON
26 lines
542 B
JSON
{
|
|
"name": "api",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "tsx watch src/index.ts",
|
|
"build": "tsc",
|
|
"lint": "eslint src/"
|
|
},
|
|
"dependencies": {
|
|
"@fastify/cors": "^11.2.0",
|
|
"@fastify/helmet": "^13.0.2",
|
|
"@shieldsai/shared-auth": "*",
|
|
"@shieldsai/shared-db": "*",
|
|
"@shieldsai/shared-utils": "*",
|
|
"fastify": "^4.25.0",
|
|
"fastify-plugin": "^4.5.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^25.6.0",
|
|
"tsx": "^4.7.1",
|
|
"typescript": "^5.3.3"
|
|
}
|
|
}
|