Middleware

    Instead of a function the method can also accept an object with a function that will take a parameter , the middleware will be mounted at and returns the actual middleware function. This allows manipulating the endpoint before creating the middleware (e.g. to document headers, request bodies, path parameters or query parameters).

    Restrict access to ArangoDB-authenticated users:

    Trivial logging middleware: