Set NEXT_PUBLIC_DOMAIN as a fallback of NEXT_PUBLIC_VERCEL_URL

This commit is contained in:
mbaharip
2024-04-06 22:24:36 +07:00
parent ca341c1b52
commit 7aea7703f6
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -4,5 +4,6 @@ NEXT_PUBLIC_ENCRYPTION_KEY=
NEXT_PUBLIC_SITE_PASSWORD=
# Only fill with the domain name, without the protocol and trailing slash
# This will be used as a fallback if VERCEL_URL is not available
# Example: https://drive-demo.mbaharip.com -> drive.mbaharip.com
NEXT_PUBLIC_DOMAIN=
+3 -1
View File
@@ -17,7 +17,9 @@ const config: z.input<typeof Schema_Config> = {
basePath:
process.env.NODE_ENV === "development"
? "http://localhost:3000"
: `https://${process.env.NEXT_PUBLIC_DOMAIN}`,
: `https://${
process.env.NEXT_PUBLIC_VERCEL_URL || process.env.NEXT_PUBLIC_DOMAIN
}`,
/**
* DEPRECATED