removed some domain dependencies

This commit is contained in:
mrfry 2023-04-11 16:18:38 +02:00
parent a1dab7a3ca
commit 50daae3cf1
4 changed files with 7 additions and 35 deletions

View file

@ -1,22 +1,10 @@
// 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.NEXT_PUBLIC_DOMAIN
if (!domain && !useLocalhost) {
throw new Error(
'Domain is not defined! Please set NEXT_PUBLIC_DOMAIN env variable!'
)
}
const constants = {
domain: domain || 'localhost',
// FIXME: remove siteUrl, replace with Link
siteUrl: useLocalhost ? 'http://localhost:8080/' : `https://${domain}/`,
apiUrl: useLocalhost
? 'http://localhost:8080/api/'
: `https://${domain}/api/`,
chatUrl: useLocalhost ? 'http://localhost:8080/' : `https://${domain}/`,
siteUrl: useLocalhost ? 'http://localhost:8080/' : '/',
apiUrl: useLocalhost ? 'http://localhost:8080/api/' : '/api/',
mobileWindowWidth: 700,
maxQuestionsToRender: 250,
imageExts: ['gif', 'png', 'jpeg', 'jpg'],