added dynamic domain

This commit is contained in:
mrfry 2023-04-08 10:16:35 +02:00
parent f82ecaa6d0
commit 199c5fe4b1
14 changed files with 185 additions and 718 deletions

View file

@ -1,12 +1,20 @@
// 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 = {
siteUrl: useLocalhost ? 'http://localhost:8080/' : 'https://frylabs.net/',
domain: domain || 'localhost',
// FIXME: remove siteUrl, replace with Link
siteUrl: useLocalhost ? 'http://localhost:8080/' : `https://${domain}/`,
apiUrl: useLocalhost
? 'http://localhost:8080/api/'
: 'https://frylabs.net/api/',
chatUrl: useLocalhost ? 'http://localhost:8080/' : 'https://frylabs.net/',
: `https://${domain}/api/`,
chatUrl: useLocalhost ? 'http://localhost:8080/' : `https://${domain}/`,
mobileWindowWidth: 700,
maxQuestionsToRender: 250,
imageExts: ['gif', 'png', 'jpeg', 'jpg'],