diff --git a/frontend/search/config.ts b/frontend/search/config.ts new file mode 100644 index 0000000..c4bbe1c --- /dev/null +++ b/frontend/search/config.ts @@ -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}) + } +} diff --git a/frontend/search/public/config.json b/frontend/search/public/config.json new file mode 100644 index 0000000..eefb5cb --- /dev/null +++ b/frontend/search/public/config.json @@ -0,0 +1,2 @@ +{"base_url": "http://localhost:3000", + "backend_base_url": "http://localhost:4000"}