3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 06:19:24 +01:00

quote list and error page

This commit is contained in:
Luke Slater 2011-09-15 12:30:52 +01:00
parent ace90011be
commit 0ab31586e9
3 changed files with 12 additions and 0 deletions

View File

@ -14,6 +14,14 @@ var webInterface = function(dbot) {
res.render('index', { });
});
app.get('/quotes/:key', function(req, res) {
if(dbot.db.quoteArrs.hasOwnProperty(req.params.key)) {
res.render('quotes', { 'quotes': dbot.db.quoteArrs[req.params.key] });
} else {
res.render('error', { 'message': 'No quotes under that key.' });
}
});
app.listen(1337);
return {

1
views/error.jade Normal file
View File

@ -0,0 +1 @@
p #{message}

3
views/quotes.jade Normal file
View File

@ -0,0 +1,3 @@
ul#quotes
-each quote in quotes
#{quote}