2023-06-09 18:21:18 +10:00
|
|
|
/* eslint-disable turbo/no-undeclared-env-vars */
|
|
|
|
export const getBaseUrl = () => {
|
|
|
|
if (typeof window !== 'undefined') {
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (process.env.VERCEL_URL) {
|
|
|
|
return `https://${process.env.VERCEL_URL}`;
|
|
|
|
}
|
|
|
|
|
2023-09-14 15:00:14 +10:00
|
|
|
if (process.env.NEXT_PUBLIC_WEBAPP_URL) {
|
|
|
|
return process.env.NEXT_PUBLIC_WEBAPP_URL;
|
2023-06-09 18:21:18 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
return `http://localhost:${process.env.PORT ?? 3000}`;
|
|
|
|
};
|