define 'inProd' as shortcut instead of process.env.NODE_ENV==='production'

This commit is contained in:
Luk Lu
2022-09-19 00:57:21 +08:00
parent 8335e7ace6
commit 6cdf2f1fb6

View File

@@ -1,12 +1,18 @@
const inDev = global.envar?.inDev || process.env.NODE_ENV !== 'production' // 用 production 测试,防止 NODE_ENV 未定义 const coretool = require('wo-core-toolkit')
module.exports = { module.exports = {
protocol: inDev ? 'http' : 'httpall', webProtocol: inProd ? 'httpall' : 'http',
host: inDev ? 'localhost' : 'vic-user.bittic.org', webHostname: inProd ? 'vic-user.bittic.org' : 'localhost',
port: undefined, webPort: inProd ? undefined : coretool.BASEPORT_WEB_SERVER + 338,
sslType: 'file', // greenlock or file webRoot: 'dist',
sslDomainList: ['vic-user.bittic.org'], webSsl: inProd
sslKey: '/etc/letsencrypt/live/vic-server.bittic.org/privkey.pem', // ssl key file, ? {
sslCert: '/etc/letsencrypt/live/vic-server.bittic.org/fullchain.pem', // ssl cert file, type: 'file', // greenlock or file
sslCA: '/etc/letsencrypt/live/vic-server.bittic.org/bundle.pem', // ssl ca file, file: {
key: './ssl/privkey.pem', // ssl key file,
cert: './ssl/fullchain.pem', // ssl cert file,
ca: './ssl/chain.pem', // ssl ca file,
},
}
: undefined,
} }