journey/server/config/site.js
Linus Miller 6048991b2d new config loading logic
- remove unused config files
- load all server env variables from ./config/env
- still define PWD as midwest seems to be using it
2020-08-28 20:48:22 +02:00

49 lines
926 B
JavaScript

'use strict'
const _ = require('lodash')
const env = require('./env')
const domain = 'journey.bitmill.io'
const defaults = {
domain,
title: 'Journey',
name: 'journey',
protocol: 'http',
get host() {
return this.port ? this.hostname + ':' + this.port : this.hostname
},
get url() {
return this.protocol + '://' + this.host + '/'
},
emails: {
robot: 'no-reply@bitmill.io',
info: 'info@bitmill.io',
webmaster: 'webmaster@tbitmill.io',
},
}
module.exports = _.merge(
defaults,
{
development: {
hostname: 'localhost',
port: process.env.EXTERNAL_PORT || process.env.PORT || require('./port'),
},
testing: {
hostname: 'localhost',
port: process.env.PORT || require('./port'),
},
staging: {
hostname: `admin.${domain}`,
},
production: {
hostname: `admin.${domain}`,
protocol: 'https',
},
}[env.NODE_ENV],
)