mirror of
https://github.com/reality/dbot.git
synced 2024-12-20 09:32:38 +01:00
22 lines
545 B
JavaScript
22 lines
545 B
JavaScript
|
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,
|
||
|
'text': text
|
||
|
});
|
||
|
}
|
||
|
};
|
||
|
};
|
||
|
|
||
|
exports.fetch = function(dbot) {
|
||
|
return pages(dbot);
|
||
|
};
|