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; }
672700cookie-checkC# Map simple routes