Unverified Commit c5d1231c authored by Alireza Heidari's avatar Alireza Heidari
Browse files

: add `getFullAppUrl` utility function

parent 0fbd20e2
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -442,6 +442,21 @@ export function hasKeys(object: unknown, keys: string[]) {
    }
}

/**
 * Get the full URL path of the app
 *
 * @param path Path to append to the URL path
 * @returns Full URL path of the app
 */
export function getFullAppUrl(path: string = ""): string {
    const protocol = window.location.protocol;
    const hostname = window.location.hostname;
    const port = window.location.port ? `:${window.location.port}` : "";
    const appRoot = getAppRoot();

    return `${protocol}//${hostname}${port}${appRoot}${path}`;
}

export default {
    cssLoadFile,
    get,