Bring back NEXT_PUBLIC_BASE_URL

This commit is contained in:
Sebastien Castiel
2024-01-19 12:43:08 -05:00
parent 18ac2142a8
commit c138afadb9
3 changed files with 19 additions and 13 deletions

View File

@@ -3,6 +3,14 @@ import { z } from 'zod'
const envSchema = z.object({
POSTGRES_URL_NON_POOLING: z.string().url(),
POSTGRES_PRISMA_URL: z.string().url(),
NEXT_PUBLIC_BASE_URL: z
.string()
.optional()
.default(
process.env.VERCEL_URL
? `https://${process.env.VERCEL_URL}`
: 'http://localhost:3000',
),
})
export const env = envSchema.parse(process.env)