mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-29 01:48:28 +00:00
12 lines
326 B
TypeScript
12 lines
326 B
TypeScript
import { get } from "svelte/store";
|
|
|
|
import env, { apiURL } from "$lib/env";
|
|
import settings from "$lib/state/settings";
|
|
|
|
export const currentApiURL = () => {
|
|
if (env.DEFAULT_API && get(settings).processing.allowDefaultOverride) {
|
|
return new URL(env.DEFAULT_API).origin;
|
|
}
|
|
return new URL(apiURL).origin;
|
|
}
|