Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

RateLimitHit

interfaz Since 1.2.0

Resultado de contar una petición en una ventana fija: el total de la ventana, incluida esta, y los milisegundos que faltan para que empiece la siguiente. Lo devuelve SessionStore.rateLimit.

ts
import type { RateLimitHit } from "@meekojs/meeko/server";

Source code src/server/runtime/rate-limit.ts:53

Declaración #

ts
interface RateLimitHit {
	readonly count: number
	readonly resetInMs: number
}

Example #

ts
import type { RateLimitHit } from "@meekojs/meeko/server";

const hit: RateLimitHit = await store.rateLimit("login:203.0.113.7", 300_000);
if (hit.count > 5) console.warn(`bloqueado ${Math.ceil(hit.resetInMs / 1000)} s`);

Propiedades #

count #

propiedad sólo lectura

readonly count: number

Peticiones contadas en la ventana actual, incluida esta.

resetInMs #

propiedad sólo lectura

readonly resetInMs: number

Milisegundos hasta que empieza la siguiente ventana.

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: packages/meeko/src/server/runtime/rate-limit.ts