diff --git a/index.js b/index.js index 85168d5..61f63bf 100644 --- a/index.js +++ b/index.js @@ -54,7 +54,7 @@ app.post('/search', (req, res) => { temp = client.db().collection("questions").find(query).toArray(function(err, data) { arr = splice(data) page = 0 + parseInt(req.body.page, 10) - res.render('index', {data: arr[page],page:page,maxpages:arr.length()}) + res.render('index', {data: arr[page],page:page,pagenums:Array.from(new Array(arr.length()), (x,i) => i),maxpages:arr.length()}) client.close() }) }); diff --git a/views/layouts/main.handlebars b/views/layouts/main.handlebars index d6d9c4b..1e67028 100644 --- a/views/layouts/main.handlebars +++ b/views/layouts/main.handlebars @@ -32,6 +32,7 @@
+