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 {LayoutConfig} from "../types/LayoutConfig";
import {BASE_URL} from "../config";
const NO_LAYOUT_CONFIG: LayoutConfig = { const NO_LAYOUT_CONFIG: LayoutConfig = {
id: "", id: "",
...@@ -13,9 +14,9 @@ export class LayoutService { ...@@ -13,9 +14,9 @@ export class LayoutService {
static async init(): Promise<void> { static async init(): Promise<void> {
try { 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[]) 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); LayoutService.configs = await Promise.all(configFetches);
} catch (e) { } catch (e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment