C# Map simple routes

Date: 2022-09-13

https://docs.microsoft.com/en-us/aspnet/core/fundamentals/routing?view=aspnetcore-6.0

public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime applicationLifetime)
    app.UseEndpoints(e => e.MapGet("/", RedirectToVersion));
    app.UseEndpoints(e => e.MapControllers());
    
    app.MapGet("/", () => "Hello World!");
}

private static Task RedirectToVersion(HttpContext x)
{
    x.Response.Redirect("/api/version", false); 
    return Task.CompletedTask;
}
67270cookie-checkC# Map simple routes