summaryrefslogtreecommitdiff
path: root/bucky
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-12-11 01:06:34 +0100
committerJules Laplace <julescarbon@gmail.com>2017-12-11 01:06:34 +0100
commit0120735ce102421a2d5178e4293f244c9225c114 (patch)
treef6a58472ec0f46782492779ef1846e2edb939e37 /bucky
parent6eff78042b152ef78538292d4263a2dbd89d78da (diff)
rearranging.
Diffstat (limited to 'bucky')
-rw-r--r--bucky/app/router.js6
-rw-r--r--bucky/search/search.js1
2 files changed, 6 insertions, 1 deletions
diff --git a/bucky/app/router.js b/bucky/app/router.js
index a793192..4f4396f 100644
--- a/bucky/app/router.js
+++ b/bucky/app/router.js
@@ -26,6 +26,12 @@ module.exports = function(app){
hoot_text: fortune("hoots"),
})
})
+ app.get("/index/:keyword", middleware.ensureAuthenticated, function(req, res){
+ res.render("pages/index", {
+ title: fortune("titles"),
+ hoot_text: fortune("hoots"),
+ })
+ })
app.get("/details/:id", middleware.ensureAuthenticated, function(req, res){
res.render("pages/details", {})
})
diff --git a/bucky/search/search.js b/bucky/search/search.js
index 6e1fd01..1236a4c 100644
--- a/bucky/search/search.js
+++ b/bucky/search/search.js
@@ -4,7 +4,6 @@ var STOPWORDS = require('./stopwords')
var wordRegexp = new RegExp("[^a-z0-9]+", 'g');
function parse_terms (s) {
-console.log(s, wordRegexp)
return s.toLowerCase().split(wordRegexp).filter((term) => !!term)
}
function cmp (a,b){ return (a<b)?-1:(a===b)?0:1 }