mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
rateLimitMiddleware: improve tsdoc comment
This commit is contained in:
parent
330b38ff68
commit
0d3c619245
1 changed files with 4 additions and 1 deletions
|
|
@ -1,8 +1,11 @@
|
|||
import { MiddlewareHandler } from '@hono/hono';
|
||||
import { rateLimiter } from 'hono-rate-limiter';
|
||||
|
||||
/** Rate limit middleware for Hono. */
|
||||
/**
|
||||
* Rate limit middleware for Hono, based on [`hono-rate-limiter`](https://github.com/rhinobase/hono-rate-limiter).
|
||||
*/
|
||||
export function rateLimitMiddleware(limit: number, windowMs: number): MiddlewareHandler {
|
||||
// @ts-ignore Mismatched hono versions.
|
||||
return rateLimiter({
|
||||
limit,
|
||||
windowMs,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue