Function parseListQuery

  • 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.

    Returns HttpMiddleware

    The new middleware.

    Example

    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)
  • Parameters

    Returns HttpMiddleware

  • Parameters

    Returns HttpMiddleware

Generated using TypeDoc