A serverless API built with Fastify, featuring rate limiting, CORS, modular routes, and custom error handling.
- Rate Limiting: Prevents abuse by limiting requests per IP.
- CORS: Restricts origins based on a configurable whitelist.
- Modular Routes: Includes
Routine,Support,Vaultly, andxcfbotmodules. - Custom Error Handling: Handles validation and internal errors gracefully.
- Status Endpoint:
/statusfor health checks.
-
Install dependencies:
npm install
-
Configure environment variables:
NODE_ENV(e.g.,developmentorproduction)PORT(default:7200)RENDER(set for deployment on Render.com)
-
Allowed Hostnames:
- Edit
allowed-hostname.jsonto set permitted CORS origins.
- Edit
node --run devGET /status— Health checkGET /— Redirects to GitHub repo- Other endpoints provided by route modules
- Logging to
log.jsonin development mode. - Custom schema validation error formatting.
- Listens on
0.0.0.0ifRENDERenv is set, otherwise onlocalhost.