From a9072370ca1eb9a5cce928b1d487db0f307edea6 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Tue, 20 Sep 2022 15:24:27 +0800 Subject: feat: Move old apps into it's own directory --- apps/kit/src/lib/configuration.ts | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 apps/kit/src/lib/configuration.ts (limited to 'apps/kit/src/lib/configuration.ts') diff --git a/apps/kit/src/lib/configuration.ts b/apps/kit/src/lib/configuration.ts new file mode 100644 index 0000000..d6f6b4f --- /dev/null +++ b/apps/kit/src/lib/configuration.ts @@ -0,0 +1,45 @@ +export const TOP_BASE_DOMAIN = "greatoffice.app"; +export const BASE_DOMAIN = "dev.greatoffice.app"; +export const DEV_BASE_DOMAIN = "http://127.0.0.1"; +export const API_ADDRESS = "https://api." + BASE_DOMAIN; +export const DEV_API_ADDRESS = "http://127.0.0.1:5000"; +export const SECONDS_BETWEEN_SESSION_CHECK = 600; + +export function base_domain(path: string = ""): string { + return (is_development() ? DEV_BASE_DOMAIN : TOP_BASE_DOMAIN) + (path !== "" ? "/" + path : ""); +} + +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" +}; + +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" +}; \ No newline at end of file -- cgit v1.3