fix: improve DATABASE_URL validation in web environment schema

This commit is contained in:
Maze Winther 2026-03-29 18:58:35 +02:00
parent 0a6ede73ae
commit b095862cc0
1 changed files with 5 additions and 4 deletions

View File

@ -11,10 +11,11 @@ const webEnvSchema = z.object({
NEXT_PUBLIC_MARBLE_API_URL: z.url(),
// Server
DATABASE_URL: z
.string()
.startsWith("postgres://")
.or(z.string().startsWith("postgresql://")),
DATABASE_URL: z.string().refine(
(url) =>
url.startsWith("postgres://") || url.startsWith("postgresql://"),
"DATABASE_URL must be a postgres:// or postgresql:// URL",
),
BETTER_AUTH_SECRET: z.string(),
UPSTASH_REDIS_REST_URL: z.url(),