Show default page

This commit is contained in:
Zalmoxisus 2016-01-21 12:12:47 +02:00
parent 56fda3de2c
commit f12bf148d0
3 changed files with 18 additions and 0 deletions

10
bin/router.js Normal file
View File

@ -0,0 +1,10 @@
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

@ -1,6 +1,13 @@
var express = require('express');
module.exports.run = function(worker) {
var app = require('express')();
var httpServer = worker.httpServer;
var scServer = worker.scServer;
httpServer.on('request', app);
app.use('/', require('./router'));
scServer.addMiddleware(scServer.MIDDLEWARE_EMIT, function (socket, channel, data, next) {
if (channel.substr(0, 3) === 'sc-' || channel === 'respond' || channel === 'log') {
scServer.exchange.publish(channel, data);

View File

@ -23,6 +23,7 @@
},
"homepage": "https://github.com/zalmoxisus/remotedev-server",
"dependencies": {
"express": "^4.13.3",
"minimist": "^1.2.0",
"socketcluster": "^3.0.0"
}