mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
16 lines
466 B
TypeScript
16 lines
466 B
TypeScript
export function getRootPath(): string {
|
|
const path = window.location.pathname;
|
|
const parts = path.split('/');
|
|
const adminIndex = parts.indexOf('admin');
|
|
const rootPath = parts.slice(0, adminIndex).join('/') + '/';
|
|
return rootPath;
|
|
}
|
|
|
|
export function getPublicURL() {
|
|
const path = window.location.href;
|
|
const parts = path.split('/');
|
|
const adminIndex = parts.indexOf('admin');
|
|
const rootPath = parts.slice(0, adminIndex).join('/') + '/';
|
|
return rootPath;
|
|
}
|