Hopefully support Heroku

This commit is contained in:
Cadence Ember
2020-04-15 02:03:38 +12:00
parent 138145fa05
commit 6c48bc9d60
4 changed files with 10 additions and 4 deletions

View File

@@ -127,6 +127,11 @@ let constants = {
// Override values from config and export the result
const md = require("mixin-deep")
const config = require("../../config")
constants = md(constants, config)
if (process.env.BIBLIOGRAM_CONFIG) { // presence of environment variable BIBLIOGRAM_CONFIG overrides /config.js
const config = JSON.parse(process.env.BIBLIOGRAM_CONFIG)
constants = md(constants, config)
} else {
const config = require("../../config")
constants = md(constants, config)
}
module.exports = constants