only use VERCEL_URL when SITE_URL is missing

This commit is contained in:
Thomas Ruoff
2020-11-11 00:02:59 +01:00
parent a5f60c1114
commit 7630f56b70

View File

@@ -1,6 +1,12 @@
const URL = process.env.VERCEL_URL let URL: string
? `https://${process.env.VERCEL_URL}`
: 'http://localhost:3000' if (process.env.SITE_URL) {
URL = `https://${process.env.SITE_URL}`
} else if (process.env.VERCEL_URL) {
URL = `https://${process.env.VERCEL_URL}`
} else {
URL = 'http://localhost:3000'
}
export function getBaseURL(): string { export function getBaseURL(): string {
return URL return URL