amphora
amphora copied to clipboard
Add db paginate
Sets us up for pagination to list endpoints like /_components/instances
- Calls
db.createReadStream()which has been modified in the storage module, for list requests - Adds
prevandsizequery params to list requests - Checks whether
prevmatches up with where it's being requested, ie. a request tonymag.com/_components/ad/instancesshould be for something likenymag.com/_components/ad/instances/aaa, and dropsprevif it's invalid, errors if it's not - Checks whether
sizeis a number and within the configured maximum, errors if it's not a number
Requires https://github.com/clay/amphora-storage-postgres/pull/64 for pagination.