fknop / hapi-pagination

Hapi plugin to handle "custom" pagination
MIT License
63 stars 36 forks source link

How to paginate POST endpoints? #66

Closed faustbrian closed 6 years ago

faustbrian commented 6 years ago

I am currently finishing up an application and found an issue with pagination on POST endpoints, specifically a search endpoint which is obviously a POST endpoint and not GET.

I saw this line https://github.com/fknop/hapi-pagination/blob/master/lib/ext.js#L41 which seems to only allow GET routes. Is there any specific reason for only allowing GET routes to be paginated?

POST routes should be fine to be paginated as long as the route contains the required query parameters.