根据 inDev 来设置dev和prod的不同环境变量值

This commit is contained in:
Luk Lu
2022-06-05 09:34:43 +08:00
parent 35708af141
commit 5e64af7b2d

View File

@@ -1,17 +1,12 @@
module.exports={ const inDev = global.inDev || global.envar?.inDev || process.env.NODE_ENV === 'development'
protocol: 'http',
host: 'localhost',
port: undefined,
ENV_PRODUCTION: { module.exports = {
protocol: 'httpall', protocol: inDev ? 'http' : 'httpall',
host: 'vic-user.bittic.org', host: inDev ? 'localhost' : 'vic-user.bittic.org',
// 如果使用 https 协议,必须填写以下内容,或在命令行参数中设置: port: undefined,
sslType: 'file', // greenlock or file sslType: 'file', // greenlock or file
sslDomainList: ['vic-user.bittic.org'], sslDomainList: ['vic-user.bittic.org'],
sslKey: '/etc/letsencrypt/live/vic-server.bittic.org/privkey.pem', // ssl key file, 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, sslCert: '/etc/letsencrypt/live/vic-server.bittic.org/fullchain.pem', // ssl cert file,
sslCA: '/etc/letsencrypt/live/vic-server.bittic.org/bundle.pem', // ssl ca file, sslCA: '/etc/letsencrypt/live/vic-server.bittic.org/bundle.pem', // ssl ca file,
},
} }