2013-04-09 17:20:07 +02:00
|
|
|
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,
|
2016-03-04 18:18:35 +01:00
|
|
|
'text': decodeURIComponent(req.params.text)
|
2013-04-09 17:20:07 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.fetch = function(dbot) {
|
|
|
|
return pages(dbot);
|
|
|
|
};
|