aboutsummaryrefslogtreecommitdiffstats
path: root/apps/kit/src/lib/configuration.ts
blob: fa828cad06256812d6c00bb240fc90d3ba21315e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
export const BASE_DOMAIN = "dev.greatoffice.app";
export const DEV_BASE_DOMAIN = "http://localhost";
export const API_ADDRESS = "https://api." + BASE_DOMAIN;
export const DEV_API_ADDRESS = "http://localhost:5000";
export const SECONDS_BETWEEN_SESSION_CHECK = 600;

export function api_base(path: string = ""): string {
    return (is_development() ? DEV_API_ADDRESS : API_ADDRESS) + (path !== "" ? "/" + path : "");
}

export function is_development(): boolean {
    // @ts-ignore
    return import.meta.env.DEV;
}

export function is_debug(): boolean {
    return localStorage.getItem(StorageKeys.debug) !== "true";
}

export const CookieNames = {
    theme: "go_theme",
    locale: "go_locale",
    session: "go_session"
};

export const QueryKeys = {
    labels: "labels",
    categories: "categories",
    entries: "entries",
};

export const StorageKeys = {
    session: "sessionData",
    theme: "theme",
    debug: "debug",
    categories: "categories",
    labels: "labels",
    entries: "entries",
    stopwatch: "stopwatchState",
    logLevel: "logLevel"
};