From 8b99be4e5f1f80e597a0267d0cef21468ed355ca Mon Sep 17 00:00:00 2001 From: DIYgod Date: Wed, 18 Sep 2019 18:28:04 +0800 Subject: [PATCH] fix: config value --- lib/app.js | 1 - lib/config.js | 5 ++++- lib/pkg.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/app.js b/lib/app.js index 1120451672..28500ad1a0 100644 --- a/lib/app.js +++ b/lib/app.js @@ -1,4 +1,3 @@ -require('dotenv').config(); require('module-alias/register'); require('./utils/request-wrapper'); diff --git a/lib/config.js b/lib/config.js index df0f1042de..f3e5b4cdd9 100644 --- a/lib/config.js +++ b/lib/config.js @@ -1,3 +1,4 @@ +require('dotenv').config(); let envs = process.env; let value; @@ -106,5 +107,7 @@ module.exports = { envs = Object.assign(process.env, env); calculateValue(); }, - value, + get value() { + return value; + }, }; diff --git a/lib/pkg.js b/lib/pkg.js index f02cacb6bf..caba9a1706 100644 --- a/lib/pkg.js +++ b/lib/pkg.js @@ -1,5 +1,5 @@ -let app; const config = require('./config'); +let app; module.exports = { init: (conf) => {