Skip to content

Rate limiting ​

Implemented with express-rate-limit in src/middleware/rateLimit.js. Limits use the draft-7 RateLimit headers and are disabled when NODE_ENV=test.

LimiterWindowLimitKeyApplied to
apiLimiter1 minute300IPAll /api routes
authLimiter15 minutes20IPregister, login, resend verification, forgot/reset password, KYC submission
sensitiveLimiter1 hour10User ID (IP fallback)Withdrawals

Exceeding a limit returns:

json
{ "error": { "code": "RATE_LIMITED", "message": "Too many requests. Please slow down and try again shortly." } }

with status 429.

Behind a proxy ​

app.set('trust proxy', 1) makes req.ip the client address when running behind one reverse proxy (Render, Railway, Nginx). Adjust if your deployment has more hops.

Scaling out ​

The default store is in-memory, so limits are per instance. When running multiple API instances, configure a shared store such as Redis.

Nexlm is a peer-to-peer facilitator and never holds customer Naira.