// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IDbUpgradeChecker dbUpgradeChecker) { loggerFactory.AddNLog(); if (_environment.IsDevelopment() || _environment.IsEnvironment("IntegrationTests")) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/error"); } app.UseSwagger(); app.UseSwaggerUI(options => { options.SwaggerEndpoint("/swagger/v1/swagger.json", GetType().GetTypeInfo().Assembly.GetName().Name); }); app.UseMvc(); dbUpgradeChecker.EnsureDatabaseUpToDate(); app.UseHealthChecks("/healthcheck", new HealthCheckOptions { Predicate = _ => true, ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse }); if (_environment.EnvironmentName.Equals("IntegrationTests") == false) { app.UseHealthChecksUI(); } }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, IDbUpgradeChecker dbUpgradeChecker) { app.UseHealthChecks("/healthcheck", new HealthCheckOptions { Predicate = _ => true, ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse }); app.UseAuthentication(); app.UseApiServices(Configuration, env); dbUpgradeChecker.EnsureDatabaseUpToDate(env); }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, IDbUpgradeChecker dbUpgradeChecker) { dbUpgradeChecker.EnsureDatabaseUpToDate(env); app.UseHealthChecks("/healthcheck", new HealthCheckOptions { Predicate = _ => true, ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse }); app.UseAuthentication(); app.UseApiServices(Configuration, env); app.UseStaticFiles(); // app.UseStaticFiles(new StaticFileOptions() // { // FileProvider = new PhysicalFileProvider( //Path.Combine(Directory.GetCurrentDirectory(), @"Resources")), // RequestPath = new PathString("/Resources") // }); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseCookiePolicy(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=SiteConfiguration}/{action=Index}/{id?}"); }); }
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IDbUpgradeChecker dbUpgradeChecker) { _startup.Configure(app, loggerFactory, dbUpgradeChecker); }