From a352264bebf4cd44fb10a62891a0c47236bafc31 Mon Sep 17 00:00:00 2001 From: nolostra Date: Fri, 20 Sep 2024 16:35:17 +0530 Subject: [PATCH] fix: made postgres optional --- src/env/server.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/env/server.ts b/src/env/server.ts index 7c33021c..65be3dd7 100644 --- a/src/env/server.ts +++ b/src/env/server.ts @@ -7,10 +7,10 @@ export const serverEnv = createEnv({ DATABASE_URL: z.string().url(), NEXTAUTH_SECRET: z.string().min(1), NEXTAUTH_URL: z.string().url(), - POSTGRES_URL: z.string().url(), - POSTGRES_HOST: z.string().min(1), - POSTGRES_USERNAME: z.string().min(1), - POSTGRES_PASSWORD: z.string().min(1), + POSTGRES_URL: z.string().url().optional(), + POSTGRES_HOST: z.string().min(1).optional(), + POSTGRES_USERNAME: z.string().min(1).optional(), + POSTGRES_PASSWORD: z.string().min(1).optional(), AWS_S3_REGION: z.string().min(1), AWS_S3_ACCESS_KEY_ID: z.string().min(1), AWS_S3_SECRET_ACCESS_KEY: z.string().min(1), @@ -23,10 +23,10 @@ export const serverEnv = createEnv({ DATABASE_URL: process.env.DATABASE_URL, NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET, NEXTAUTH_URL: process.env.NEXTAUTH_URL, - POSTGRES_URL: process.env.POSTGRES_URL, - POSTGRES_HOST: process.env.POSTGRES_HOST, - POSTGRES_USERNAME: process.env.POSTGRES_USERNAME, - POSTGRES_PASSWORD: process.env.POSTGRES_PASSWORD, + POSTGRES_URL: process.env.POSTGRES_URL ?? '', + POSTGRES_HOST: process.env.POSTGRES_HOST ?? '', + POSTGRES_USERNAME: process.env.POSTGRES_USERNAME ?? '', + POSTGRES_PASSWORD: process.env.POSTGRES_PASSWORD ?? '', AWS_S3_REGION: process.env.AWS_S3_REGION, AWS_S3_ACCESS_KEY_ID: process.env.AWS_S3_ACCESS_KEY_ID, AWS_S3_SECRET_ACCESS_KEY: process.env.AWS_S3_SECRET_ACCESS_KEY,