I have this RoutingHelper
:
public static class RoutingHelper
{
public static RequestDelegate OrbisDefaultRoute
=> async context =>
{
var version = Environment.GetEnvironmentVariable("CI_PIPELINE_ID") ?? ":(";
var result = new
{
version,
Environment.MachineName,
Assembly.GetExecutingAssembly().GetName().Name,
DateTime.Now
};
await context.Response.WriteAsync(JsonConvert.SerializeObject(result));
};
public static Action<IEndpointRouteBuilder> OrbisControllerDefaultRoute
=> builder => builder.MapControllerRoute("Default", "/");
}
I added this helper in my Startup.cs
as you can see :
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(RoutingHelper.OrbisControllerDefaultRoute)
.UseEndpoints(endpoints => endpoints.MapControllers());
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
Authorization = new[] { new CustomAuthorizationFilter() }
});
}
But when I call the localhost:5052 I get 404 error code .Why?