diff --git a/apiServer.js b/apiServer.js index 690d4c7249..ef4502645d 100755 --- a/apiServer.js +++ b/apiServer.js @@ -86,7 +86,8 @@ app.get('/libraries', function(req, res) { if (req.query.search) { var searchParams = { typoTolerance: 'min', // only keep the minimum typos - hitsPerPage: 1000 // maximum + page: req.query.page || 0, // default + hitsPerPage: req.query.hitsPerPage || 1000 // maximum }; algoliaIndex.search(req.query.search, searchParams, function(error, content) { if (error) { diff --git a/templates/api.html b/templates/api.html index b1507d52dc..99b900420b 100644 --- a/templates/api.html +++ b/templates/api.html @@ -40,6 +40,14 @@
npm or git)
https://api.cdnjs.com/libraries?search=[query]&hitsPerPage=10
+ https://api.cdnjs.com/libraries?search=[query]&hitsPerPage=10&page=2
+ output=human
like so: