dbot/modules/web.js

31 lines
629 B
JavaScript
Raw Normal View History

2011-09-13 22:23:46 +02:00
var express = require('express');
var webInterface = function(dbot) {
var dbot = dbot;
2011-09-13 22:55:20 +02:00
var pub = '../public';
var app = express.createServer();
app.use(express.compiler({ src: pub, enable: ['sass'] }));
app.use(express.static(pub));
app.set('view engine', 'jade');
2011-09-13 22:23:46 +02:00
app.get('/', function(req, res) {
res.render('index', { });
2011-09-13 23:03:02 +02:00
console.log('test');
2011-09-13 22:23:46 +02:00
});
app.listen(1337);
2011-09-14 18:24:32 +02:00
return {
'onDestroy': function() {
console.log('on destroy');
2011-09-14 18:24:32 +02:00
process.exit();
}
};
2011-09-13 22:23:46 +02:00
};
exports.fetch = function(dbot) {
return webInterface(dbot);
};