All files / src config.ts

66.66% Statements 4/6
50% Branches 1/2
100% Functions 0/0
66.66% Lines 4/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19      7x             7x   7x         7x  
import "dotenv/config";
import { z } from "zod/v4";
 
const envSchema = z.object({
  DATABASE_URL: z.url(),
  JWT_SECRET: z.string().min(32),
  PORT: z.coerce.number().default(3000),
  HOST: z.string().default("0.0.0.0"),
});
 
const parsed = envSchema.safeParse(process.env);
 
Iif (!parsed.success) {
  console.error("Invalid environment variables:", z.prettifyError(parsed.error));
  process.exit(1);
}
 
export const config = parsed.data;