diff options
author | Raccoon | 2017-03-03 09:22:35 +0800 |
---|---|---|
committer | GitHub | 2017-03-03 09:22:35 +0800 |
commit | 48592d692c2b8a71e3ca9e7f0bc34f230eea1542 (patch) | |
tree | 053538d49b92121e29e0e576d2e5e0b249d28537 /app.js | |
parent | a8b99638b2bc4db0dffd643b96287faf4f97e030 (diff) | |
parent | 0bea4da6238b1f46562b146b32d88fc8d8b9060a (diff) |
Merge branch 'master' into feature/addSecrets
Diffstat (limited to 'app.js')
-rw-r--r-- | app.js | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -26,7 +26,6 @@ var validator = require('validator'); var config = require("./lib/config.js"); var logger = require("./lib/logger.js"); var auth = require("./lib/auth.js"); -var history = require("./lib/history.js"); var response = require("./lib/response.js"); var models = require("./lib/models"); @@ -443,6 +442,7 @@ app.get('/logout', function (req, res) { req.logout(); res.redirect(config.serverurl + '/'); }); +var history = require("./lib/history.js"); //get history app.get('/history', history.historyGet); //post history @@ -502,7 +502,7 @@ app.post('/uploadimage', function (req, res) { switch (config.imageUploadType) { case 'filesystem': res.send({ - link: url.resolve(config.serverurl, files.image.path.match(/^public(.+$)/)[1]) + link: url.resolve(config.serverurl + '/', files.image.path.match(/^public\/(.+$)/)[1]) }); break; @@ -608,7 +608,7 @@ function startListen() { // sync db then start listen models.sequelize.sync().then(function () { // check if realtime is ready - if (history.isReady() && realtime.isReady()) { + if (realtime.isReady()) { models.Revision.checkAllNotesRevision(function (err, notes) { if (err) throw new Error(err); if (!notes || notes.length <= 0) return startListen(); @@ -639,7 +639,7 @@ function handleTermSignals() { }, 0); }); var checkCleanTimer = setInterval(function () { - if (history.isReady() && realtime.isReady()) { + if (realtime.isReady()) { models.Revision.checkAllNotesRevision(function (err, notes) { if (err) return logger.error(err); if (!notes || notes.length <= 0) { |