3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-24 12:59:34 +01:00
dbot/modules/flashy/pages.js

22 lines
556 B
JavaScript
Raw Normal View History

var _ = require('underscore')._;
var pages = function(dbot) {
return {
'/flashy/:colour/:text': function(req, res) {
if(!_.has(this.colourMap, req.params.colour)) {
req.params.colour = 'red';
}
var colour = this.colourMap[req.params.colour];
res.render('flashy', {
'name': dbot.config.name,
'colour': colour,
2013-04-09 17:30:56 +02:00
'text': req.params.text
});
}
};
};
exports.fetch = function(dbot) {
return pages(dbot);
};