christmas/config/index.js
2020-11-03 22:01:52 -05:00

19 lines
912 B
JavaScript

require('dotenv').config();
const yesNo = require('yes-no');
module.exports = {
dbPrefix: process.env.DB_PREFIX || 'dbs/',
defaultFailureRedirect: process.env.DEFAULT_FAILURE_REDIRECT || '/login',
port: Number(process.env.PORT) || 3000,
dbExposePort: Number(process.env.DB_EXPOSE_PORT) || null,
proxyServer: process.env.PROXY_SERVER || undefined,
secret: process.env.SECRET || require('./secret'),
sessionMaxAge: Number(process.env.SESSION_MAX_AGE) || 1000 * 60 * 60 * 24 * 7,
siteTitle: process.env.SITE_TITLE || 'Christmas Community',
shortTitle: process.env.SHORT_TITLE || 'Christmas',
useCDN: yesNo.parse(process.env.USE_CDN || true),
wishlist: require('./wishlist'),
base: (process.env.ROOT_PATH || '/').endsWith('/') ? (process.env.ROOT_PATH || '/') : `${process.env.ROOT_PATH}/`,
trustProxy: process.env.TRUST_PROXY === 'true' ? true : process.env.TRUST_PROXY || 'loopback'
};