Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

RateLimit

import type { RateLimit } from "https://gitlab.com/soapbox-pub/strfry-policies/-/raw/develop/mod.ts";

Policy options for rateLimitPolicy.

interface RateLimit {
databaseUrl?: string;
interval?: number;
max?: number;
whitelist?: string[];
}

§Properties

§
databaseUrl?: string
[src]

Database connection string. Default: sqlite:///tmp/strfry-rate-limit-policy.sqlite3

§
interval?: number
[src]

How often (ms) to check whether max has been exceeded. Default: 60000 (1 minute).

§
max?: number
[src]

Max number of requests within the interval until the IP is rate-limited. Default: 10.

§
whitelist?: string[]
[src]

List of IP addresses to skip this policy.