using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using System; namespace k8s.Tests.Mock.Server { /// /// Startup logic for the KubeClient WebSockets test server. /// public class Startup { /// /// Initializes a new instance of the class. /// Create a new . /// public Startup() { } /// /// Configure application services. /// /// /// The service collection to configure. /// public static void ConfigureServices(IServiceCollection services) { if (services == null) { throw new ArgumentNullException(nameof(services)); } services.AddLogging(logging => { logging.ClearProviders(); // Logger provider will be added by the calling test. }); services.AddMvc(opt => opt.EnableEndpointRouting = false); } /// /// Configure the application pipeline. /// /// /// The application pipeline builder. /// public static void Configure(IApplicationBuilder app) { app.UseWebSockets(new WebSocketOptions { KeepAliveInterval = TimeSpan.FromSeconds(5), }); app.UseMvc(); } } }