diff options
| author | Sebastien Castiel <sebastien@castiel.me> | 2024-01-19 12:43:08 -0500 |
|---|---|---|
| committer | Sebastien Castiel <sebastien@castiel.me> | 2024-01-19 12:43:17 -0500 |
| commit | c138afadb9a7c6e04113ea6a7fd19d0f46050e68 (patch) | |
| tree | b87ce0ac668b59001aff2078fd0f842ced77244d /src/lib/env.ts | |
| parent | 18ac2142a8544069267640fa1f6f9b92356c2cce (diff) | |
Bring back NEXT_PUBLIC_BASE_URL
Diffstat (limited to 'src/lib/env.ts')
| -rw-r--r-- | src/lib/env.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/env.ts b/src/lib/env.ts index 31b91e7..3db102e 100644 --- a/src/lib/env.ts +++ b/src/lib/env.ts @@ -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) |
