* gen v1.23.0 * fix converter * bump ver * update readme runtime * fix warning * update dep ver * newtonjson -> system.text.json * generate for new json api * readme lf * dotnet fmt * dotnet fmt tests/ * dotnet fmt * Revert "dotnet fmt" This reverts commit e14c59076143fe2218ed899295a00762f0ea2bd6. * fix err introduce by dotnet fmt * fix test * remove deprecated /watch api * generate code after /watch removed * remove /watch related code * trim Microsoft.Rest.Serialization
57 lines
1.6 KiB
C#
57 lines
1.6 KiB
C#
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
using System;
|
|
|
|
namespace k8s.Tests.Mock.Server
|
|
{
|
|
/// <summary>
|
|
/// Startup logic for the KubeClient WebSockets test server.
|
|
/// </summary>
|
|
public class Startup
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="Startup"/> class.
|
|
/// Create a new <see cref="Startup"/>.
|
|
/// </summary>
|
|
public Startup()
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Configure application services.
|
|
/// </summary>
|
|
/// <param name="services">
|
|
/// The service collection to configure.
|
|
/// </param>
|
|
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);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Configure the application pipeline.
|
|
/// </summary>
|
|
/// <param name="app">
|
|
/// The application pipeline builder.
|
|
/// </param>
|
|
public static void Configure(IApplicationBuilder app)
|
|
{
|
|
app.UseWebSockets(new WebSocketOptions
|
|
{
|
|
KeepAliveInterval = TimeSpan.FromSeconds(5),
|
|
});
|
|
app.UseMvc();
|
|
}
|
|
}
|
|
}
|