mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 12:19:06 +00:00
github debug
This commit is contained in:
@@ -32,5 +32,28 @@ export function edgeDomainToKey(domain: string) {
|
|||||||
export async function getConfig() {
|
export async function getConfig() {
|
||||||
const domain = new URL(process.env.NEXT_PUBLIC_SITE_URL!).hostname;
|
const domain = new URL(process.env.NEXT_PUBLIC_SITE_URL!).hostname;
|
||||||
|
|
||||||
return require("../../config-template").localConfig;
|
if ("1" === "1") {
|
||||||
|
console.error("process.env", process.env);
|
||||||
|
throw new Error("hello");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isCI) {
|
||||||
|
// "noop"
|
||||||
|
return require("../../config-template").localConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.env.NEXT_PUBLIC_ENV === "development" && !isCI) {
|
||||||
|
return require("../../config").localConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
let config = await get(edgeDomainToKey(domain));
|
||||||
|
|
||||||
|
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 fetching config");
|
||||||
|
|
||||||
|
return config as DomainConfig;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user