Middleware

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

    Restrict access to ArangoDB-authenticated users:

    Trivial logging middleware: