www: fix edge config to go on default by default

This commit is contained in:
2023-11-02 12:32:35 +01:00
parent 61d1e6b06b
commit 0d9f66c097

View File

@@ -39,11 +39,13 @@ export async function getConfig(domain: string) {
}
let config = await get(edgeDomainToKey(domain));
console.warn("No config for this domain, falling back to default");
config = await get(edgeDomainToKey("default"));
if (typeof config !== "object") {
console.warn("No config for this domain, falling back to default");
config = await get(edgeDomainToKey("default"));
}
if (typeof config !== "object") throw Error("Error fetchig config");
if (typeof config !== "object") throw Error("Error fetching config");
return config as DomainConfig;
}