You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 23, 2022. It is now read-only.
hi this is my app.module @global() @module({
imports: [
RateLimiterModule.register(rateLimiterConfig),
],
providers: [{ provide: APP_GUARD, useClass: RateLimiterGuard }],
and this is my config file
import { createConnection } from 'typeorm';
const connection = createConnection({
type: 'postgres',
host: process.env.DATABASE_HOST || 'localhost',
port: Number(process.env.DATABASE_PORT) || 5432,
username: process.env.DATABASE_USERNAME || 'postgres',
password: process.env.DATABASE_PASSWORD || 'postgres',
database: process.env.DATABASE_NAME,
});
i'm sure that my connection information is right it even create the table and record when i send request but i get Rate limit exceeded in first request but if i use Memory it works just fine. how can i fix this?
thx in advance and sorry for my bad eng
The text was updated successfully, but these errors were encountered:
abdollahzadehAli
changed the title
Rate limit exceeded in first request and saving ip from request
Rate limit exceeded in first request
Apr 5, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
hi this is my app.module
@global()
@module({
imports: [
RateLimiterModule.register(rateLimiterConfig),
],
providers: [{ provide: APP_GUARD, useClass: RateLimiterGuard }],
and this is my config file
import { createConnection } from 'typeorm';
const connection = createConnection({
type: 'postgres',
host: process.env.DATABASE_HOST || 'localhost',
port: Number(process.env.DATABASE_PORT) || 5432,
username: process.env.DATABASE_USERNAME || 'postgres',
password: process.env.DATABASE_PASSWORD || 'postgres',
database: process.env.DATABASE_NAME,
});
export const rateLimiterConfig: RateLimiterOptions = {
for: 'Express',
type: 'Postgres',
keyPrefix: 'global',
points: 10,
pointsConsumed: 1,
duration: 60,
blockDuration: 3600,
whiteList: [],
blackList: [],
storeClient: connection,
dbName: 'test,
tableName: 'rate_limiter',
clearExpiredByTimeout: false,
errorMessage: 'Rate limit exceeded',
};
i'm sure that my connection information is right it even create the table and record when i send request but i get Rate limit exceeded in first request but if i use Memory it works just fine. how can i fix this?
thx in advance and sorry for my bad eng
The text was updated successfully, but these errors were encountered: