14 lines
501 B
TypeScript
14 lines
501 B
TypeScript
|
|
import { z } from 'zod';
|
||
|
|
|
||
|
|
const envSchema = z.object({
|
||
|
|
PORT: z.coerce.number().default(3000),
|
||
|
|
DATABASE_URL: z.string().default('postgresql://localhost:5432/dd0c_alert'),
|
||
|
|
REDIS_URL: z.string().default('redis://localhost:6379'),
|
||
|
|
JWT_SECRET: z.string().min(32).default('dev-secret-change-me-in-production!!'),
|
||
|
|
CORS_ORIGIN: z.string().default('*'),
|
||
|
|
LOG_LEVEL: z.string().default('info'),
|
||
|
|
});
|
||
|
|
|
||
|
|
export const config = envSchema.parse(process.env);
|
||
|
|
export type Config = z.infer<typeof envSchema>;
|