From 7630f56b70b8834544ec47d1433a12cb7835b2b5 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Wed, 11 Nov 2020 00:02:59 +0100 Subject: [PATCH] only use VERCEL_URL when SITE_URL is missing --- helpers/url.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/helpers/url.ts b/helpers/url.ts index df9f9a2..dea0c06 100644 --- a/helpers/url.ts +++ b/helpers/url.ts @@ -1,6 +1,12 @@ -const URL = process.env.VERCEL_URL - ? `https://${process.env.VERCEL_URL}` - : 'http://localhost:3000' +let URL: string + +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 { return URL