Skip to content

Commit

Permalink
Merge pull request #10 from TypingMind/fix/setting-env
Browse files Browse the repository at this point in the history
chore: set default value
  • Loading branch information
travis-thuanle authored Mar 16, 2024
2 parents b284bcb + 307d5ff commit d3ed959
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/common/utils/envConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { cleanEnv, host, num, port, str } from 'envalid';
dotenv.config();

export const env = cleanEnv(process.env, {
NODE_ENV: str({ choices: ['development', 'test', 'production'] }),
HOST: host(),
PORT: port(),
CORS_ORIGIN: str(),
COMMON_RATE_LIMIT_MAX_REQUESTS: num(),
COMMON_RATE_LIMIT_WINDOW_MS: num(),
NODE_ENV: str({ choices: ['development', 'test', 'production'], default: 'production' }),
HOST: host({ default: 'localhost' }),
PORT: port({ default: 3000 }),
CORS_ORIGIN: str({ default: '*' }),
COMMON_RATE_LIMIT_MAX_REQUESTS: num({ default: 100 }),
COMMON_RATE_LIMIT_WINDOW_MS: num({ default: 60000 }),
});

0 comments on commit d3ed959

Please sign in to comment.