Middlewares
Require auth
Requires env variable JWT_KEY
Check for it's value and throws otherwise
Decodes the jwt and sets it to req.currentUser
Error handler
Catches global errors and generate standard responses for them following the CustomError structure
Validate request
Throws errors for express-validator errors