[doc] Document the middleware before method.