24 lines
766 B
TypeScript
24 lines
766 B
TypeScript
export const appConfig = () => ({
|
|
port: parseInt(process.env.APP_PORT || '3010', 10),
|
|
env: process.env.NODE_ENV || 'development',
|
|
apiPrefix: process.env.API_PREFIX || 'api/v1',
|
|
})
|
|
|
|
export const databaseConfig = () => ({
|
|
url: process.env.DATABASE_URL,
|
|
})
|
|
|
|
export const jwtConfig = () => ({
|
|
secret: process.env.JWT_SECRET || 'default-jwt-secret-change-in-production',
|
|
expiresIn: process.env.JWT_EXPIRES_IN || '7d',
|
|
})
|
|
|
|
export const redisConfig = () => ({
|
|
host: process.env.REDIS_HOST || 'localhost',
|
|
port: parseInt(process.env.REDIS_PORT || '6379', 10),
|
|
password: process.env.REDIS_PASSWORD,
|
|
db: parseInt(process.env.REDIS_DB || '9', 10),
|
|
})
|
|
|
|
export const configurations = [appConfig, databaseConfig, jwtConfig, redisConfig]
|