Hopefully support Heroku

This commit is contained in:
Cadence Ember 2020-04-15 02:03:38 +12:00
parent 138145fa05
commit 6c48bc9d60
No known key found for this signature in database
GPG Key ID: 128B99B1B74A6412
4 changed files with 10 additions and 4 deletions

1
Procfile Normal file
View File

@ -0,0 +1 @@
web: npm run $(test "$BIBLIOGRAM_ENTRY" = 'assistant' && echo 'assistant' || echo 'start')

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

View File

@ -5,7 +5,7 @@ const constants = require("../lib/constants")
const passthrough = require("./passthrough")
const pinski = new Pinski({
port: constants.port,
port: +process.env.PORT || constants.port,
relativeRoot: __dirname
})

View File

@ -5,7 +5,7 @@ const constants = require("../lib/constants")
const passthrough = require("./passthrough")
const pinski = new Pinski({
port: constants.port,
port: +process.env.PORT || constants.port,
relativeRoot: __dirname,
basicCacheControl: {
exts: ["ttf", "woff2", "png", "jpg", "jpeg", "svg", "gif", "webmanifest", "ico"],