Move router to the worker

This commit is contained in:
Zalmoxisus 2016-01-21 12:26:37 +02:00
parent f12bf148d0
commit 943a1c0120
2 changed files with 5 additions and 11 deletions

View File

@ -1,10 +0,0 @@
var express = require('express');
var router = express.Router();
router.get('', function( req, res ) {
res.send('<html><body>' +
'<p>It works! Now point your app and monitor app to connect to this server.</p>' +
'</body></html>');
});
module.exports = router;

View File

@ -6,7 +6,11 @@ module.exports.run = function(worker) {
var scServer = worker.scServer; var scServer = worker.scServer;
httpServer.on('request', app); httpServer.on('request', app);
app.use('/', require('./router')); app.get('/', function(req, res) {
res.send('<html><body>' +
'<p>It works! Now point your app and monitor app to connect to this server.</p>' +
'</body></html>');
});
scServer.addMiddleware(scServer.MIDDLEWARE_EMIT, function (socket, channel, data, next) { scServer.addMiddleware(scServer.MIDDLEWARE_EMIT, function (socket, channel, data, next) {
if (channel.substr(0, 3) === 'sc-' || channel === 'respond' || channel === 'log') { if (channel.substr(0, 3) === 'sc-' || channel === 'respond' || channel === 'log') {