Compare commits

...

3 Commits

Author SHA1 Message Date
Ephraim Duncan
77231e31f7 Merge branch 'main' into fix/sitemap 2024-11-21 12:32:34 +00:00
Ephraim Atta-Duncan
3d7912586e fix: use APP_BASE_URL 2024-11-21 12:32:04 +00:00
Ephraim Atta-Duncan
a67894f384 fix: sitemap showing vercel deployment url 2024-11-17 23:04:52 +00:00

View File

@@ -1,20 +1,20 @@
/* 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 = () => {
if (typeof window !== 'undefined') {
return '';
}
const marketingAppUrl = APP_BASE_URL();
if (marketingAppUrl) {
return marketingAppUrl;
}
if (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}`;
};