using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; using Microsoft.Extensions.DependencyInjection; using HeuristicLab.Clients.Hive.WebJobManager.Services; using Microsoft.Extensions.Configuration; using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.PluginInfrastructure; namespace HeuristicLab.Clients.Hive.WebJobManager { public class Startup { public IHostingEnvironment hostingEnvironment { get; set; } public Startup(IHostingEnvironment hostingEnvironment) { var builder = new ConfigurationBuilder() .AddJsonFile("conf.json") .AddEnvironmentVariables(); var config = builder.Build(); ApplicationManager.InitializeForWeb(); ContentManager.Initialize(new PersistenceContentManager()); //Console.WriteLine(""+ config.Get("configuration")); this.hostingEnvironment = hostingEnvironment; } // This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddSingleton(); services.AddSingleton(); services.AddSignalR(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app) { if (hostingEnvironment.IsDevelopment()) app.UseDeveloperExceptionPage(); app.UseIISPlatformHandler(); app.UseStaticFiles(); app.UseSignalR(); app.UseStatusCodePages(); app.UseMvcWithDefaultRoute(); } // Entry point for the application. public static void Main(string[] args) => WebApplication.Run(args); } }