Skip to content
Snippets Groups Projects
Commit e36e901e authored by Niklas Schrötler's avatar Niklas Schrötler
Browse files

LayoutService: Implemented support for sub-urls

parent 66ca5323
No related branches found
No related tags found
No related merge requests found
export const BASE_URL = "/infoscreen"; // No trailing slash
import {LayoutConfig} from "../types/LayoutConfig";
import {BASE_URL} from "../config";
const NO_LAYOUT_CONFIG: LayoutConfig = {
id: "",
......@@ -13,9 +14,9 @@ export class LayoutService {
static async init(): Promise<void> {
try {
const activeConfigs = await fetch("/activeConfigs.json").then(content => content.json());
const activeConfigs = await fetch(BASE_URL + "/activeConfigs.json").then(content => content.json());
const configFetches = (activeConfigs as string[])
.map(configPath => fetch(configPath).then(content => content.json()));
.map(configPath => fetch(BASE_URL + "/" + configPath).then(content => content.json()));
LayoutService.configs = await Promise.all(configFetches);
} catch (e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment