Files
pi-ku/frontend/utils/url-builder.ts
T
2026-04-17 01:22:03 +05:30

10 lines
271 B
TypeScript

export const getBaseUrl = (
isSslEnabled: boolean,
domain: string | undefined,
port: string | undefined,
): string => {
const uriScheme = isSslEnabled ? "https" : "http";
const baseURL = `${uriScheme}://${domain}${port ? `:${port}` : ""}`;
return baseURL;
};