-
Notifications
You must be signed in to change notification settings - Fork 51
/
config.js
28 lines (22 loc) · 889 Bytes
/
config.js
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
/* Responsible for reading config to present to other modules. */
import { mapValues } from 'lodash'
import { isJsonString } from './utils/StringUtils'
const rawConfig = window.config
const config = mapValues(rawConfig || {}, (value) =>
isJsonString(value) ? JSON.parse(value) : value)
// URL this app is deployed to
export const appUrl = config.appUrl || ''
// Base URL for API requests
export const apiUrl = config.apiServerUrl || '/rest'
// Base URL for links to pages that are not part of this app
export const serverUrl = config.serverUrl || ''
export const links = config.links || {}
export const auth = config.auth
export const isLoggedIn = config.permission
? config.permission.isLoggedIn
: false
export const isAdmin = config.permission
? config.permission.isAdmin
: false
export const user = config.user
export const allowRegister = config.allowRegister || false