MCPcopy Index your code
hub / github.com/linuxfoundation/crowd.dev / createRateLimiter

Function createRateLimiter

backend/src/api/apiRateLimiter.ts:3–28  ·  view source on GitHub ↗
({
  max,
  windowMs,
  message,
}: {
  max: number
  windowMs: number
  message: string
})

Source from the content-addressed store, hash-verified

1import rateLimit from 'express-rate-limit'
2
3export function createRateLimiter({
4 max,
5 windowMs,
6 message,
7}: {
8 max: number
9 windowMs: number
10 message: string
11}) {
12 return rateLimit({
13 max,
14 windowMs,
15 message,
16 skip: (req) => {
17 if (req.method === 'OPTIONS') {
18 return true
19 }
20
21 if (req.originalUrl.endsWith('/import')) {
22 return true
23 }
24
25 return false
26 },
27 })
28}

Callers 2

index.tsFile · 0.90
index.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected