@@ -13,22 +13,18 @@ namespace WebStatus
1313{
1414 public class Startup
1515 {
16- public Startup ( IHostingEnvironment env )
16+ public Startup ( IConfiguration configuration )
1717 {
18- var builder = new ConfigurationBuilder ( )
19- . SetBasePath ( env . ContentRootPath )
20- . AddJsonFile ( "appsettings.json" , optional : false , reloadOnChange : true )
21- . AddJsonFile ( $ "appsettings.{ env . EnvironmentName } .json", optional : true )
22- . AddEnvironmentVariables ( ) ;
23- Configuration = builder . Build ( ) ;
18+ Configuration = configuration ;
2419 }
2520
26- public IConfigurationRoot Configuration { get ; }
21+ public IConfiguration Configuration { get ; }
2722
2823 // This method gets called by the runtime. Use this method to add services to the container.
2924 public void ConfigureServices ( IServiceCollection services )
3025 {
3126 services . AddOptions ( ) ;
27+
3228 // Add framework services.
3329 services . AddHealthChecks ( checks =>
3430 {
@@ -47,15 +43,13 @@ public void ConfigureServices(IServiceCollection services)
4743 checks . AddUrlCheckIfNotNull ( Configuration [ "mvc" ] , TimeSpan . FromMinutes ( minutes ) ) ;
4844 checks . AddUrlCheckIfNotNull ( Configuration [ "spa" ] , TimeSpan . FromMinutes ( minutes ) ) ;
4945 } ) ;
46+
5047 services . AddMvc ( ) ;
5148 }
5249
5350 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
54- public void Configure ( IApplicationBuilder app , IHostingEnvironment env , ILoggerFactory loggerFactory )
51+ public void Configure ( IApplicationBuilder app , IHostingEnvironment env )
5552 {
56- loggerFactory . AddConsole ( Configuration . GetSection ( "Logging" ) ) ;
57- loggerFactory . AddDebug ( ) ;
58-
5953 if ( env . IsDevelopment ( ) )
6054 {
6155 app . UseDeveloperExceptionPage ( ) ;
0 commit comments