This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // articles per page | |
| var limit = 10; | |
| // pagination middleware function sets some | |
| // local view variables that any view can use | |
| function pagination(req, res, next) { | |
| var page = parseInt(req.params.page) || 1, | |
| num = page * limit; | |
| db.articles.count(function(err, total) { | |
| res.local("total", total); |
NewerOlder