Files
clube67_newwhats.local/clube67/newwhats.local/backend/src/config/env.ts
T
VPS 4 Deploy Agent 2f8c04a0a7
continuous-integration/webhook Falha no deploy de clube67_newwhats.local (VPS 4)
chore(ops): restore all source files in newwhats.clube67.com
2026-05-18 03:28:29 +02:00

28 lines
954 B
TypeScript

import { z } from 'zod'
import 'dotenv/config'
const envSchema = z.object({
PORT: z.string().default('8008'),
NODE_ENV: z.enum(['development', 'production', 'test']).default('development'),
JWT_SECRET: z.string().min(16),
DATABASE_URL: z.string().url(),
DRAGONFLY_URL: z.string().default('redis://localhost:6379'),
DRAGONFLY_TTL_SECONDS: z.string().default('86400'),
NATS_URL: z.string().default('nats://localhost:4222'),
TEMPORAL_ADDRESS: z.string().default('localhost:7233'),
TEMPORAL_NAMESPACE: z.string().default('default'),
TEMPORAL_TASK_QUEUE: z.string().default('newwhats-queue'),
BAILEYS_SESSIONS_PATH: z.string().default('./sessions'),
FRONTEND_URL: z.string().default('http://localhost:3000'),
})
const parsed = envSchema.safeParse(process.env)
if (!parsed.success) {
console.error('❌ Variáveis de ambiente inválidas:')
console.error(parsed.error.format())
process.exit(1)
}
export const env = parsed.data