public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseCors(policy => { policy.AllowAnyOrigin() .AllowAnyHeader() .AllowAnyMethod(); }); app.UseMvc(); var healthCheckResponseWriterProvider = new HealthCheckerResponseProvider(env); app.UseHealthChecks("/health/ready", new HealthCheckOptions { Predicate = check => check.Tags.Contains("ready"), ResponseWriter = healthCheckResponseWriterProvider.Writer }); app.UseHealthChecks("/health/live", new HealthCheckOptions { Predicate = _ => false, ResponseWriter = healthCheckResponseWriterProvider.Writer }); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } var healthCheckResponseWriterProvider = new HealthCheckerResponseProvider(env); app.UseHealthChecks("/health/ready", new HealthCheckOptions { Predicate = check => check.Tags.Contains("ready"), ResponseWriter = healthCheckResponseWriterProvider.Writer }); app.UseHealthChecks("/health/live", new HealthCheckOptions { Predicate = _ => false, ResponseWriter = healthCheckResponseWriterProvider.Writer }); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); }); app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { AutofacContainer = app.ApplicationServices.GetAutofacRoot(); ApplicationBootstrap.SetAutofacContainer(AutofacContainer); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseCors(policy => { policy.AllowAnyOrigin() .AllowAnyHeader() .AllowAnyMethod(); }); var healthCheckResponseWriterProvider = new HealthCheckerResponseProvider(env); app.UseHealthChecks("/health/ready", new HealthCheckOptions { Predicate = check => check.Tags.Contains("ready"), ResponseWriter = healthCheckResponseWriterProvider.Writer }); app.UseHealthChecks("/health/live", new HealthCheckOptions { Predicate = _ => false, ResponseWriter = healthCheckResponseWriterProvider.Writer }); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); }); app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }