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:
parent
7d1bddd7e2
commit
d310895fcb
9 changed files with 53 additions and 29 deletions
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,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue