wynn/src/config/index.ts
2025-02-26 21:56:30 -06:00

22 lines
566 B
TypeScript

import { z } from 'zod';
import { parseEnv} from 'znv';
import {config as dotenvConfig} from 'dotenv';
dotenvConfig();
const schemaConfig = {
DISCORD_TOKEN: z.string(),
TEMPORAL_HOSTPORT: z.string().default('localhost:7233'),
TEMPORAL_NAMESPACE: z.string().default('default'),
PG_URL: z.string().optional(),
PG_USER: z.string().optional(),
PG_HOST: z.string().optional(),
PG_PASSWORD: z.string().optional(),
PG_DATABASE: z.string().optional(),
PG_PORT: z.number().int().optional(),
};
export const config = parseEnv(process.env, schemaConfig)