mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-21 15:14:52 +00:00
Remove env endpoint and mark live APIs no-store
This commit is contained in:
@@ -40,20 +40,11 @@ export async function getServerConfigFromClient(): Promise<ServerConfig> {
|
||||
}
|
||||
|
||||
const bootstrapGameEnv = window.BOOTSTRAP_CONFIG?.gameEnv;
|
||||
if (bootstrapGameEnv) {
|
||||
cachedSC = getServerConfig(bootstrapGameEnv);
|
||||
return cachedSC;
|
||||
if (!bootstrapGameEnv) {
|
||||
throw new Error("Missing bootstrap server config");
|
||||
}
|
||||
|
||||
const response = await fetch("/api/env");
|
||||
if (!response.ok) {
|
||||
throw new Error(
|
||||
`Failed to fetch server config: ${response.status} ${response.statusText}`,
|
||||
);
|
||||
}
|
||||
const config = await response.json();
|
||||
|
||||
cachedSC = getServerConfig(config.game_env);
|
||||
cachedSC = getServerConfig(bootstrapGameEnv);
|
||||
return cachedSC;
|
||||
}
|
||||
export function getServerConfigFromServer(): ServerConfig {
|
||||
|
||||
Reference in New Issue
Block a user