APIErrorMiddleware
APIErrorMiddleware copied to clipboard
error initializing
Hello.
first of all, I think docs are outdated, cause APIErrorMiddleware requires an environment variable.
I tried to add the middleware:
let auth = router.grouped("auth").group(APIErrorMiddleware(environment: Environment.development))
but it fails with error Type of expression is ambiguous without more context
How can I fix this?
Thanks in advance, Dan.
I'm having the same issue.
I got mine working by registering the service first in my app's configure function:
services.register(APIErrorMiddleware.self)