feat: add constants for regions

This commit is contained in:
Christy Jacob
2024-11-12 09:34:38 +01:00
parent 2f744a8849
commit 2c4af1f44a
2 changed files with 9 additions and 8 deletions
+8
View File
@@ -2,6 +2,14 @@ export const PAGE_LIMIT = 12; // default page limit
export const CARD_LIMIT = 6; // default card limit
export const INTERVAL = 5 * 60000; // default interval to check for feedback
export const REGION_FRA = 'fra';
export const REGION_SYD = 'syd';
export const REGION_NYC = 'nyc';
export const SUBDOMAIN_FRA = 'fra.';
export const SUBDOMAIN_SYD = 'syd.';
export const SUBDOMAIN_NYC = 'nyc.';
export enum Dependencies {
FACTORS = 'dependency:factors',
IDENTITIES = 'dependency:identities',
+1 -8
View File
@@ -24,6 +24,7 @@ import {
import { Billing } from '../sdk/billing';
import { Backups } from '../sdk/backups';
import { Sources } from '$lib/sdk/sources';
import { REGION_FRA, REGION_NYC, REGION_SYD, SUBDOMAIN_FRA, SUBDOMAIN_NYC, SUBDOMAIN_SYD } from '$lib/constants';
export function getApiEndpoint(region?: string): string {
if (VARS.APPWRITE_ENDPOINT) return VARS.APPWRITE_ENDPOINT;
@@ -33,14 +34,6 @@ export function getApiEndpoint(region?: string): string {
return `${protocol}://${subdomain}${hostname}/v1`;
}
const REGION_FRA = 'fra';
const REGION_SYD = 'syd';
const REGION_NYC = 'nyc';
const SUBDOMAIN_FRA = 'fra.';
const SUBDOMAIN_SYD = 'syd.';
const SUBDOMAIN_NYC = 'nyc.';
const getSubdomain = (region?: string) => {
switch (region) {
case REGION_FRA: