Makes dynamic configuration work in production

If a static file is mounted in the Docker image, it will be read at
each page load and sent to the client.
This commit is contained in:
2023-08-11 11:00:18 +02:00
parent 99b91a7ebb
commit 8660345bf6
7 changed files with 47 additions and 24 deletions

36
src/lib/config.ts Normal file
View File

@@ -0,0 +1,36 @@
import configData from '../config.yml';
export type Brand = {
logo?: string;
icon?: string;
usemask?: boolean;
};
export type Section = {
title: string;
subtitle?: string;
} & Brand;
export type Service = {
url: string;
target?: string;
type?: string;
[x: string]: unknown;
} & Section;
export type ServiceGroup = {
items: Service[];
} & Section;
export type Config = {
services: ServiceGroup[];
} & Section;
export const config: Config = {
...{
title: 'Flanders',
services: []
},
...configData
};