provide config for codegen

This commit is contained in:
Winzlieb - 2022-03-09 15:38:00 +01:00
parent 344d1a8d0a
commit 1a9088e3e9
2 changed files with 13 additions and 0 deletions

11
frontend/search/config.ts Normal file
View File

@ -0,0 +1,11 @@
import * as default_config from './public/config.json'
export let config = default_config /** to infer the types **/
let config_fetched = false
export async function fetch_config () {
if(!config_fetched) {
await fetch("/config.json").then(async res => {config = await res.json()
config_fetched = true})
}
}

View File

@ -0,0 +1,2 @@
{"base_url": "http://localhost:3000",
"backend_base_url": "http://localhost:4000"}