Skip to content

Latest commit

 

History

History
33 lines (18 loc) · 858 Bytes

clientIsRateLimited.md

File metadata and controls

33 lines (18 loc) · 858 Bytes

elections-cpl.api.hscc.bdpa.orgDocs


elections-cpl.api.hscc.bdpa.org / lib/next-limit / clientIsRateLimited

Function: clientIsRateLimited()

clientIsRateLimited(req): Promise<object>

Returns an object with two keys: isLimited and retryAfter. If isLimited is true, then the request should be rejected. The client should be instructed to retry their request after retryAfter milliseconds have passed.

Parameters

req: NextApiRequest

Returns

Promise<object>

isLimited

isLimited: boolean = !!limited

retryAfter

retryAfter: number

Source

lib/next-limit/index.ts:36