FRE-4493: Implement API gateway with rate limiting and routing
- 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}
This commit is contained in:
25
apps/api/package.json
Normal file
25
apps/api/package.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user