From aca01f064d605d8f143d75f0fd1c1a82b9a8f396 Mon Sep 17 00:00:00 2001 From: BoHong Li Date: Thu, 13 Apr 2017 00:20:28 +0800 Subject: refactor: Remove `require` extension filename --- lib/response.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/response.js') diff --git a/lib/response.js b/lib/response.js index 13a94bbf..1d1db319 100755 --- a/lib/response.js +++ b/lib/response.js @@ -10,8 +10,8 @@ var request = require('request') var moment = require('moment') // core -var config = require('./config.js') -var logger = require('./logger.js') +var config = require('./config') +var logger = require('./logger') var models = require('./models') // public -- cgit v1.2.3 From ecb05336055a37ba8a03c119995cd37d96aad90d Mon Sep 17 00:00:00 2001 From: BoHong Li Date: Thu, 13 Apr 2017 01:57:55 +0800 Subject: refactor(config.js): Extract config file * Separate different config source to each files * Freeze config object --- lib/response.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'lib/response.js') diff --git a/lib/response.js b/lib/response.js index 1d1db319..a9abd1d4 100755 --- a/lib/response.js +++ b/lib/response.js @@ -59,14 +59,14 @@ function showIndex (req, res, next) { url: config.serverurl, useCDN: config.usecdn, allowAnonymous: config.allowanonymous, - facebook: config.facebook, - twitter: config.twitter, - github: config.github, - gitlab: config.gitlab, - dropbox: config.dropbox, - google: config.google, - ldap: config.ldap, - email: config.email, + facebook: config.isFacebookEnable, + twitter: config.isTwitterEnable, + github: config.isGitHubEnable, + gitlab: config.isGitLabEnable, + dropbox: config.isDropboxEnable, + google: config.isGoogleEnable, + ldap: config.isLDAPEnable, + email: config.isEmailEnable, allowemailregister: config.allowemailregister, signin: req.isAuthenticated(), infoMessage: req.flash('info'), @@ -89,14 +89,14 @@ function responseHackMD (res, note) { title: title, useCDN: config.usecdn, allowAnonymous: config.allowanonymous, - facebook: config.facebook, - twitter: config.twitter, - github: config.github, - gitlab: config.gitlab, - dropbox: config.dropbox, - google: config.google, - ldap: config.ldap, - email: config.email, + facebook: config.isFacebookEnable, + twitter: config.isTwitterEnable, + github: config.isGitHubEnable, + gitlab: config.isGitLabEnable, + dropbox: config.isDropboxEnable, + google: config.isGoogleEnable, + ldap: config.isLDAPEnable, + email: config.isEmailEnable, allowemailregister: config.allowemailregister }) } -- cgit v1.2.3