From ebac7f79d32c524de750adc3bcf1cc539625d552 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 7 Sep 2015 14:04:18 -0400 Subject: split up partials and stub in mailbox frontend --- lib/bucky.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/bucky.js') diff --git a/lib/bucky.js b/lib/bucky.js index a429fb3..997d680 100644 --- a/lib/bucky.js +++ b/lib/bucky.js @@ -103,6 +103,19 @@ var bucky = module.exports = { /* KEYWORDS */ + ensureKeyword: function (req, res, next){ + var keyword = req.params.keyword + if (! keyword) { + res.sendStatus(404) + } + db.getKeyword(keyword).then(function(k){ + if (! k) { + return res.sendStatus(404) + } + res.keyword = k + next() + }) + }, ensureThreadsForKeyword: function (req, res, next){ var keyword = req.params.keyword if (! keyword) { -- cgit v1.2.3-70-g09d2