- Create API gateway service with Express.js - Implement sliding window rate limiting via Redis - Add API key management with tiered access (free/developer/enterprise) - Track usage analytics per key and globally - Add RPC proxy to blockchain nodes - Configure Docker Compose with api-gateway and redis services - Free tier: 100 req/min, Developer: 1000 req/min, Enterprise: unlimited
30 lines
703 B
JSON
30 lines
703 B
JSON
{
|
|
"name": "@synor/api-gateway",
|
|
"version": "0.1.0",
|
|
"description": "Public API gateway for Synor blockchain",
|
|
"main": "dist/index.js",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "tsx watch src/index.ts",
|
|
"build": "tsc",
|
|
"start": "node dist/index.js",
|
|
"test": "vitest"
|
|
},
|
|
"dependencies": {
|
|
"express": "^4.18.2",
|
|
"ioredis": "^5.3.2",
|
|
"uuid": "^9.0.0",
|
|
"http-proxy-middleware": "^2.0.6",
|
|
"helmet": "^7.1.0",
|
|
"cors": "^2.8.5"
|
|
},
|
|
"devDependencies": {
|
|
"@types/express": "^4.17.21",
|
|
"@types/node": "^20.10.0",
|
|
"@types/cors": "^2.8.17",
|
|
"@types/uuid": "^9.0.7",
|
|
"tsx": "^4.7.0",
|
|
"typescript": "^5.3.3",
|
|
"vitest": "^1.0.0"
|
|
}
|
|
}
|