function init(): string {
if (process.env.BASE_PATH) {
return process.env.BASE_PATH;
}
if (typeof window != "undefined" && typeof window.location != "undefined") {
const { pathname } = window.location;
const i = pathname.lastIndexOf("/static");
if (i != -1) {
return i == 0 ? "/" : pathname.slice(0, i);
}
}
return "/";
}
export let appBasePath: string = init();