Compare commits

...

3 Commits

View File

@ -1,20 +1,20 @@
/* eslint-disable turbo/no-undeclared-env-vars */ /* eslint-disable turbo/no-undeclared-env-vars */
import { NEXT_PUBLIC_WEBAPP_URL } from '../constants/app'; import { APP_BASE_URL } from '../constants/app';
export const getBaseUrl = () => { export const getBaseUrl = () => {
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
return ''; return '';
} }
const marketingAppUrl = APP_BASE_URL();
if (marketingAppUrl) {
return marketingAppUrl;
}
if (process.env.VERCEL_URL) { if (process.env.VERCEL_URL) {
return `https://${process.env.VERCEL_URL}`; return `https://${process.env.VERCEL_URL}`;
} }
const webAppUrl = NEXT_PUBLIC_WEBAPP_URL();
if (webAppUrl) {
return webAppUrl;
}
return `http://localhost:${process.env.PORT ?? 3000}`; return `http://localhost:${process.env.PORT ?? 3000}`;
}; };