public void Configure(IApplicationBuilder app, IHostingEnvironment env, ISiteStatusCheckService siteStatusCheckService) { app.UseDeveloperExceptionPage(); app.UseStatusCodePages(); app.UseStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=SiteStatusCheck}/{action=Index}"); }); siteStatusCheckService.InitializeSiteStatusChecking(); }