url-helpers.ts

18 lines | 533 B Blame History Raw Download
export function GetUrl(): string {
    return location.protocol + "//" + location.host + "/";
}

export function IsLocalhost(): boolean {
    return location.href.indexOf("://localhost") != -1;
}

export function GetOutputFrameUrl(path: string = ""): string {
    var v = "?v=" + (+new Date());
    if (IsLocalhost()) {
        return "http://localhost:8021/" + path + v;
    }
    else {
        return "https://outputframe.davidmeincke.dk/" + path + v;
        //return "https://codeeditoroutput.z16.web.core.windows.net/";
    }
}