|
@@ -583,11 +583,16 @@ router.get('/ShowAgg/:appId', function (req, res, next) {
|
|
|
|
|
|
router.get('/downloadedapps/', function (req, res, next) {
|
|
|
var filter = {};
|
|
|
+ var perPage = 10;
|
|
|
+ var page = 0;
|
|
|
|
|
|
if(req.query.genre) {
|
|
|
filter.genreId = { $regex: '.*' + req.query.genre + '.*' };
|
|
|
}
|
|
|
- models.app.find(filter)
|
|
|
+ if(req.query.page) {
|
|
|
+ page = req.query.page;
|
|
|
+ }
|
|
|
+ models.app.find(filter).sort('title').skip(perPage * page).limit(20)
|
|
|
.then((apps) => apps.map(function (app) {
|
|
|
app.url = "http://localhost:3000/crawler/downloadedapps/" + app.appId;
|
|
|
return app;
|