fix: improve DATABASE_URL validation in web environment schema
This commit is contained in:
parent
0a6ede73ae
commit
b095862cc0
|
|
@ -11,10 +11,11 @@ const webEnvSchema = z.object({
|
||||||
NEXT_PUBLIC_MARBLE_API_URL: z.url(),
|
NEXT_PUBLIC_MARBLE_API_URL: z.url(),
|
||||||
|
|
||||||
// Server
|
// Server
|
||||||
DATABASE_URL: z
|
DATABASE_URL: z.string().refine(
|
||||||
.string()
|
(url) =>
|
||||||
.startsWith("postgres://")
|
url.startsWith("postgres://") || url.startsWith("postgresql://"),
|
||||||
.or(z.string().startsWith("postgresql://")),
|
"DATABASE_URL must be a postgres:// or postgresql:// URL",
|
||||||
|
),
|
||||||
|
|
||||||
BETTER_AUTH_SECRET: z.string(),
|
BETTER_AUTH_SECRET: z.string(),
|
||||||
UPSTASH_REDIS_REST_URL: z.url(),
|
UPSTASH_REDIS_REST_URL: z.url(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue