Middlewares can be specified as strings or functions.