code: public static <T> Middleware<AsyncHandler<Response<T>>, AsyncHandler<Response<ByteString>>>
    htmlSerializeResponse(final String templateName) {
      return handler ->
          requestContext -> handler.invoke(requestContext)
              .thenApply(response -> response
                  .withPayload(serialize(templateName, response.payload().orElse(null)))
                  .withHeader(CONTENT_TYPE, HTML));
    }
docs: Async middleware for a Response object.
  
  @param templateName The template name, respective to the "resources" folder
  @param <T>          The Type of the parameters
  @return the middlware