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:
parent
ace90011be
commit
0ab31586e9
@ -14,6 +14,14 @@ var webInterface = function(dbot) {
|
|||||||
res.render('index', { });
|
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);
|
app.listen(1337);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
1
views/error.jade
Normal file
1
views/error.jade
Normal file
@ -0,0 +1 @@
|
|||||||
|
p #{message}
|
3
views/quotes.jade
Normal file
3
views/quotes.jade
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
ul#quotes
|
||||||
|
-each quote in quotes
|
||||||
|
#{quote}
|
Loading…
Reference in New Issue
Block a user