Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/drash/src/modules/middleware/RateLimiter/RateLimitResponse.ts>RateLimitResponseBuilder

A microframework for building JavaScript HTTP applications. Runtime-agnostic. Strongly typed.
Latest
class RateLimitResponseBuilder
import { RateLimitResponseBuilder } from "https://deno.land/x/drash@v3.0.0-beta.2/src/modules/middleware/RateLimiter/RateLimitResponse.ts";

A Response decorator that attaches the following behaviors:

  • Response building
  • X-RateLimit-* header setting

Constructors

new
RateLimitResponseBuilder(response: Response)

Decorate a Response with X-RateLimit-* header capabilities.

Properties

protected
decoratee: Response

The response to decorate.

Methods

addRateLimitHeaders(values: { limit: number; remaining: number; reset: number; retry_after: Date; })

Add the x-ratelimit-* headers to the response.