From 5e64af7b2db9c629ad155115a3fedb9bf675d3fd Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Sun, 5 Jun 2022 09:34:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=20inDev=20=E6=9D=A5=E8=AE=BE?= =?UTF-8?q?=E7=BD=AEdev=E5=92=8Cprod=E7=9A=84=E4=B8=8D=E5=90=8C=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=8F=98=E9=87=8F=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- envar-base-basic.js | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/envar-base-basic.js b/envar-base-basic.js index 43cfd2c..fddcc18 100644 --- a/envar-base-basic.js +++ b/envar-base-basic.js @@ -1,17 +1,12 @@ -module.exports={ - protocol: 'http', - host: 'localhost', +const inDev = global.inDev || global.envar?.inDev || process.env.NODE_ENV === 'development' + +module.exports = { + protocol: inDev ? 'http' : 'httpall', + host: inDev ? 'localhost' : 'vic-user.bittic.org', port: undefined, - - ENV_PRODUCTION: { - protocol: 'httpall', - host: 'vic-user.bittic.org', - // 如果使用 https 协议,必须填写以下内容,或在命令行参数中设置: - sslType: 'file', // greenlock or file - sslDomainList: ['vic-user.bittic.org'], - 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, - sslCA: '/etc/letsencrypt/live/vic-server.bittic.org/bundle.pem', // ssl ca file, - }, - -} \ No newline at end of file + sslType: 'file', // greenlock or file + sslDomainList: ['vic-user.bittic.org'], + 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, + sslCA: '/etc/letsencrypt/live/vic-server.bittic.org/bundle.pem', // ssl ca file, +}