refactor(config.js): Extract config file

* Separate different config source to each files
* Freeze config object
This commit is contained in:
BoHong Li 2017-04-13 01:57:55 +08:00 committed by Raccoon Li
parent 4738ba7d36
commit ecb0533605
15 changed files with 767 additions and 618 deletions

View file

@ -28,7 +28,8 @@ var realtime = {
secure: secure,
connection: connection,
getStatus: getStatus,
isReady: isReady
isReady: isReady,
maintenance: true
}
function onAuthorizeSuccess (data, accept) {
@ -699,7 +700,7 @@ function updateHistory (userId, note, time) {
}
function connection (socket) {
if (config.maintenance) return
if (realtime.maintenance) return
parseNoteIdFromSocket(socket, function (err, noteId) {
if (err) {
return failConnection(500, err, socket)