// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app) { // ----- Error Handling ----- app.UseCustomizedErrorHandling(_env); app.UseRouting(); // ----- CORS ----- app.UseCors(x => x .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader()); // ----- Auth ----- app.UseCustomizedAuth(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); // ----- Health check ----- HealthCheckExtension.UseCustomizedHealthCheck(endpoints, _env); }); // ----- Swagger UI ----- app.UseCustomizedSwagger(_env); }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.UseCustomizedErrorHandling(_env); app.UseRouting(); app.UseCors(x => x .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader()); app.UseEndpoints(endpoints => { endpoints.MapControllers(); HealthCheckExtension.UseCustomizedHealthCheck(endpoints, _env); }); app.UseCustomizedSwagger(_env); }