mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 07:43:16 +10:00
wip: refresh design
This commit is contained in:
16
packages/lib/universal/get-base-url.ts
Normal file
16
packages/lib/universal/get-base-url.ts
Normal file
@ -0,0 +1,16 @@
|
||||
/* 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}`;
|
||||
}
|
||||
|
||||
if (process.env.NEXT_PUBLIC_SITE_URL) {
|
||||
return `https://${process.env.NEXT_PUBLIC_SITE_URL}`;
|
||||
}
|
||||
|
||||
return `http://localhost:${process.env.PORT ?? 3000}`;
|
||||
};
|
||||
Reference in New Issue
Block a user