Render worker.options.port

This commit is contained in:
Jhen
2016-02-19 11:56:55 +08:00
parent 7dbd60c155
commit 0269d0ce20
3 changed files with 9 additions and 7 deletions

View File

@ -7,8 +7,10 @@ module.exports.run = function(worker) {
var scServer = worker.scServer;
httpServer.on('request', app);
app.set('view engine', 'ejs');
app.get('/', function(req, res) {
res.sendFile(path.join(__dirname, 'index.html'));
res.render('index', { port: worker.options.port });
});
app.post('/', function(req, res) {
if (!req.body.data) return res.status(404).end();