nodejs server side module for angular-pagninate-anything
nodejs server side module for angular-paginate-anything
This nodejs module add the required headers in the http response to paginate the items. This is a rewrite of clean_pagination
npm install node-paginate-anything
var paginate = require('node-paginate-anything');
var queryParameters = paginate(ClientRequest, ServerResponse, totalItems, maxRangeSize);
mongooseQuery.limit(queryParameters.limit);
mongooseQuery.skip(queryParameters.skip);
parameter | Description |
---|---|
ClientRequest | clientRequest object from the native http module or from an express app. |
ServerResponse | ServerResponse object to modify before sending the http response. |
totalItems | total number of items in the result set. |
maxRangeSize | angular-paginate-anything send is own requested range in the request, this parameter specify the maximum value. |
per_page
andpage
parameters, allows the client to request any (possibly unbounded)