Move router to the worker
This commit is contained in:
parent
f12bf148d0
commit
943a1c0120
@ -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;
|
|
@ -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') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user