Files
quicklanch-server/src/app/configs/index.ts
T

39 lines
927 B
TypeScript

import "dotenv/config";
function getEnv(key: string): string {
const value = process.env[key];
if (!value) {
throw new Error(`Missing required environment variable: ${key}`);
}
return value;
}
export const configs = {
port: getEnv("PORT"),
env: getEnv("NODE_ENV"),
db_url: getEnv("DATABASE_URL"),
jwt: {
access_token: getEnv("ACCESS_TOKEN"),
access_expires: getEnv("ACCESS_EXPIRES"),
reset_secret: getEnv("RESET_SECRET"),
reset_expires: getEnv("RESET_EXPIRES"),
front_end_url: getEnv("FRONT_END_URL"),
verified_token: getEnv("VERIFIED_TOKEN"),
},
email: {
app_email: getEnv("APP_USER_EMAIL"),
app_password: getEnv("APP_PASSWORD"),
},
cloudinary: {
cloud_name: getEnv("CLOUD_NAME"),
cloud_api_key: getEnv("CLOUD_API_KEY"),
cloud_api_secret: getEnv("CLOUD_API_SECRET"),
},
redis_url: getEnv("REDIS_URL"),
};