mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
21 lines
716 B
TypeScript
21 lines
716 B
TypeScript
import { registerAs } from '@nestjs/config';
|
|
|
|
export const appConfig = registerAs('app', () => ({
|
|
port: parseInt(process.env.PORT ?? '3000', 10),
|
|
nodeEnv: process.env.NODE_ENV ?? 'development',
|
|
}));
|
|
|
|
export const dbConfig = registerAs('db', () => ({
|
|
url: process.env.DATABASE_URL ?? 'postgres://projectx:projectx@localhost:5432/projectx',
|
|
}));
|
|
|
|
export const authConfig = registerAs('auth', () => ({
|
|
jwtSecret: process.env.JWT_SECRET ?? 'change-me-in-production',
|
|
jwtExpiresIn: process.env.JWT_EXPIRES_IN ?? '15m',
|
|
jwtRefreshExpiresIn: process.env.JWT_REFRESH_EXPIRES_IN ?? '7d',
|
|
}));
|
|
|
|
export const storageConfig = registerAs('storage', () => ({
|
|
booksPath: process.env.BOOKS_PATH ?? '/data/books',
|
|
}));
|