The new middleware.
import assert from 'assert'
import createServer, { query } from '@egomobile/http-server'
import { parseListQuery } from '@egomobile/api-utils'
async function main() {
const app = createServer()
app.get(
'/',
[query(), parseListQuery()],
async (request, response) => {
assert.strictEqual(typeof request.listQuery, 'object')
}
)
await app.listen()
}
main().catch(console.error)
Generated using TypeDoc
Creates a new middleware, which parses the values from 'query' prop of request context and extracts the values, which can be used to query through lists / collections.