From 0120735ce102421a2d5178e4293f244c9225c114 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 11 Dec 2017 01:06:34 +0100 Subject: rearranging. --- bucky/app/router.js | 6 ++++++ bucky/search/search.js | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'bucky') 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