mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 04:22:32 +10:00
18 lines
387 B
TypeScript
18 lines
387 B
TypeScript
/* eslint-disable turbo/no-undeclared-env-vars */
|
|
import { NEXT_PUBLIC_WEBAPP_URL } from '../constants/app';
|
|
import { env } from '../utils/env';
|
|
|
|
export const getBaseUrl = () => {
|
|
if (typeof window !== 'undefined') {
|
|
return '';
|
|
}
|
|
|
|
const webAppUrl = NEXT_PUBLIC_WEBAPP_URL();
|
|
|
|
if (webAppUrl) {
|
|
return webAppUrl;
|
|
}
|
|
|
|
return `http://localhost:${env('PORT') ?? 3000}`;
|
|
};
|