Update env

This commit is contained in:
sianida26 2024-02-23 21:08:54 +07:00
parent 06db4e892e
commit 7032dcaa42
2 changed files with 5 additions and 7 deletions

5
env.ts
View File

@ -2,8 +2,8 @@ import { z } from "zod";
const envVariables = z.object({ const envVariables = z.object({
DATABASE_URL: z.string(), DATABASE_URL: z.string(),
JWT_SECRET: z.string(), JWT_SECRET: z.string(),
WS_PORT: z.string(), WS_PORT: z.string().optional(),
WS_HOST: z.string() WS_HOST: z.string().optional()
}); });
envVariables.parse(process.env); envVariables.parse(process.env);
@ -12,4 +12,3 @@ declare global {
interface ProcessEnv extends z.infer<typeof envVariables> {} interface ProcessEnv extends z.infer<typeof envVariables> {}
} }
} }

View File

@ -5,10 +5,9 @@
"scripts": { "scripts": {
"check-env": "bun run ./env.ts", "check-env": "bun run ./env.ts",
"dev": "bun run check-env && next dev", "dev": "bun run check-env && next dev",
"build": "next build", "build": "bun run check-env && next build",
"start": "next start", "start": "bun run check-env && next start",
"lint": "next lint", "lint": "next lint"
"key:generate": "bun run src/core/utils/generateJwtSecret.ts"
}, },
"prisma": { "prisma": {
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts" "seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"