//import { environment } from 'environments/environment';
import { environment } from '@/environment';

export function getApplicationLocation(): string {
  let pathName = location.pathname;
  console.log("start Path-name: '" + pathName + "'");
  console.log("check with:      '" + environment.applName + '/' + "'");
  if (pathName.startsWith('/' + environment.applName + '/')) {
    pathName = pathName.substring(environment.applName.length + 2);
  } else if (pathName.startsWith('/' + environment.applName)) {
    pathName = pathName.substring(environment.applName.length + 1);
  } else if (pathName.startsWith(environment.applName + '/')) {
    pathName = pathName.substring(environment.applName.length + 1);
  } else if (pathName.startsWith(environment.applName)) {
    pathName = pathName.substring(environment.applName.length);
  }
  console.log("result: '" + pathName + "'");
  return pathName;
}
