mirror of
https://gitlab.com/MrFry/qmining-data-editor
synced 2025-04-01 20:24:01 +02:00
added dynamic domain
This commit is contained in:
parent
39dfd7a0f4
commit
5a665bc766
10 changed files with 1537 additions and 1455 deletions
19
src/constants.js
Normal file
19
src/constants.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
// eslint-disable-next-line no-undef
|
||||
const useLocalhost = process && process.env.NODE_ENV === 'development'
|
||||
// eslint-disable-next-line no-undef
|
||||
const domain = process && process.env.DOMAIN
|
||||
|
||||
if (!domain && !useLocalhost) {
|
||||
throw new Error('Domain is not defined! Please set DOMAIN env variable!')
|
||||
}
|
||||
|
||||
const constants = {
|
||||
domain: domain || 'localhost',
|
||||
siteUrl: useLocalhost ? 'http://localhost:8080/' : `https://${domain}/`,
|
||||
apiUrl: useLocalhost
|
||||
? 'http://localhost:8080/api/'
|
||||
: `https://${domain}/api/`,
|
||||
maxQuestionsToRender: 250,
|
||||
}
|
||||
|
||||
export default constants
|
Loading…
Add table
Add a link
Reference in a new issue