Files
Umbraco-CMS/src/Umbraco.Web.UI.Client/index.ts

22 lines
529 B
TypeScript
Raw Normal View History

2023-05-24 15:18:30 +02:00
import { UmbAppElement } from './src/apps/app/app.element.js';
2023-05-23 21:17:25 +02:00
import { startMockServiceWorker } from './src/mocks';
2022-05-20 17:45:09 +02:00
2022-08-08 11:53:59 +02:00
if (import.meta.env.VITE_UMBRACO_USE_MSW === 'on') {
startMockServiceWorker();
}
const appElement = new UmbAppElement();
const isMocking = import.meta.env.VITE_UMBRACO_USE_MSW === 'on';
if (!isMocking) {
appElement.serverUrl = import.meta.env.VITE_UMBRACO_API_URL;
}
if (import.meta.env.DEV) {
appElement.backofficePath = '/';
}
appElement.bypassAuth = isMocking;
document.body.appendChild(appElement);