public async Task BeforeAll() { _host = await new KestrelHost() .ConfigureServices(services => { services.AddGrpc(options => { options.ResponseCompressionAlgorithm = options.CompressionProviders[0].EncodingName; options.ResponseCompressionLevel = CompressionLevel.Optimal; }); services.AddServiceModelGrpcSwagger(); services.AddOpenApiDocument(); services.AddMvc(); }) .ConfigureApp(app => { app.UseOpenApi(); // serve OpenAPI/Swagger documents app.UseSwaggerUi3(); // serve Swagger UI app.UseReDoc(); // serve ReDoc UI app.UseServiceModelGrpcSwaggerGateway(); }) .ConfigureEndpoints(endpoints => { endpoints.MapGrpcService <MultipurposeService>(); }) .StartAsync(HttpProtocols.Http1) .ConfigureAwait(false); var document = await OpenApiDocument .DownloadAsync(_host.GetLocation("swagger/v1/swagger.json")) .ConfigureAwait(false); _client = new SwaggerUiClient(document, nameof(IMultipurposeService), _host.GetLocation()); }
public async Task BeforeAll() { _host = await new KestrelHost() .ConfigureServices(services => { services.AddServiceModelGrpcSwagger(); services.AddOpenApiDocument(); services.AddMvc(); }) .ConfigureApp(app => { app.UseOpenApi(); // serve OpenAPI/Swagger documents app.UseSwaggerUi3(); // serve Swagger UI app.UseReDoc(); // serve ReDoc UI app.UseServiceModelGrpcSwaggerGateway(); }) .ConfigureEndpoints(endpoints => { endpoints.MapGrpcService <HeadersService>(); }) .StartAsync(HttpProtocols.Http1) .ConfigureAwait(false); var document = await OpenApiDocument .DownloadAsync(_host.GetLocation("swagger/v1/swagger.json")) .ConfigureAwait(false); _client = new SwaggerUiClient(document, nameof(IHeadersService), _host.GetLocation()); }