generated from hhimanshu/create-react-ts-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.ts
24 lines (20 loc) · 734 Bytes
/
constants.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
export const isHostLocal: boolean = new Set<string>([
'development',
'test',
]).has(process.env.NODE_ENV);
const isHostStaged: boolean = process.env.NODE_ENV === 'staging';
export const isHostProduction: boolean = process.env.NODE_ENV === 'production';
const hostName = isHostLocal
? ''
: isHostStaged
? // to demonstrate that you can have multiple different locations where API is hosted
''
: 'https://listbusinesses.vercel.app';
export const url = `${hostName}/api`;
export type BusinessRoutes = 'businesses' | 'randomBusiness';
export const Routes: Map<BusinessRoutes, string> = new Map<
BusinessRoutes,
string
>();
Routes.set('businesses', '/businesses');
Routes.set('randomBusiness', '/business/random');