diff options
Diffstat (limited to 'apps/web-shared/src/lib/configuration.ts')
| -rw-r--r-- | apps/web-shared/src/lib/configuration.ts | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/apps/web-shared/src/lib/configuration.ts b/apps/web-shared/src/lib/configuration.ts new file mode 100644 index 0000000..f597bb4 --- /dev/null +++ b/apps/web-shared/src/lib/configuration.ts @@ -0,0 +1,60 @@ +export const API_ADDRESS = "https://api.dev.greatoffice.life"; +export const PROJECTS_ADDRESS = "https://projects.dev.greatoffice.life"; +export const ACCOUNTS_ADDRESS = "https://a.dev.greatoffice.life"; +export const FRONTPAGE_ADDRESS = "https://greatoffice.life"; +export const DEV_ACCOUNTS_ADDRESS = "http://localhost:3001"; +export const DEV_FRONTPAGE_ADDRESS = "http://localhost:3002"; +export const DEV_API_ADDRESS = "http://localhost:5000"; +export const DEV_PROJECTS_ADDRESS = "http://localhost:3000"; +export const SECONDS_BETWEEN_SESSION_CHECK = 600; + +export function projects_base(path: string): string { + return (is_development() ? DEV_PROJECTS_ADDRESS : PROJECTS_ADDRESS) + (path ? "/" + path : "/"); +} + +export function frontpage_base(path: string): string { + return (is_development() ? DEV_FRONTPAGE_ADDRESS : FRONTPAGE_ADDRESS) + (path ? "/" + path : "/"); +} + +export function accounts_base(path: string): string { + return (is_development() ? DEV_ACCOUNTS_ADDRESS : ACCOUNTS_ADDRESS) + (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 IconNames = { + github: "github", + verticalDots: "verticalDots", + clock: "clock", + trash: "trash", + pencilSquare: "pencilSquare", + x: "x", + funnel: "funnel", + funnelFilled: "funnelFilled", + refresh: "refresh", + resetHard: "resetHard", + arrowUp: "arrowUp", + arrowDown: "arrowDown", + chevronDown: "chevronDown" +}; + +export const StorageKeys = { + session: "sessionData", + theme: "theme", + debug: "debug", + categories: "categories", + labels: "labels", + entries: "entries", + stopwatch: "stopwatchState" +}; |
