wikipedia-game-solver/apps/api/config/limiter.ts
Théo LUDWIG 4add77856e
All checks were successful
Chromatic / chromatic (push) Successful in 2m58s
CI / ci (push) Successful in 4m43s
CI / commitlint (push) Successful in 15s
chore: try Adonis Tuyau
2024-08-16 01:50:11 +01:00

27 lines
628 B
TypeScript

import env from "#start/env.ts"
import { defineConfig, stores } from "@adonisjs/limiter"
const limiterConfig = defineConfig({
default: env.get("LIMITER_STORE"),
stores: {
/**
* Database store to save rate limiting data inside a database.
*/
database: stores.database({
tableName: "rate_limits",
clearExpiredByTimeout: true,
}),
/**
* Memory store could be used during testing.
*/
memory: stores.memory({}),
},
})
export default limiterConfig
declare module "@adonisjs/limiter/types" {
export interface LimitersList extends InferLimiters<typeof limiterConfig> {}
}