mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
added support for DOMAIN env var insted of file
This commit is contained in:
15
src/constants.ts
Normal file
15
src/constants.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { paths } from './utils/files'
|
||||
import utils from './utils/utils'
|
||||
|
||||
const domain = process.env.DOMAIN || utils.ReadFile(paths.domainFile).trim()
|
||||
|
||||
if (!domain) {
|
||||
throw new Error(
|
||||
`Domain is undefined! Should be set with 'DOMAIN' environment variable, or written to '${paths.domainFile}'`
|
||||
)
|
||||
}
|
||||
|
||||
export default {
|
||||
savedQuestionsFileName: 'savedQuestions.json',
|
||||
domain: domain,
|
||||
}
|
Reference in New Issue
Block a user