using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; using Microsoft.Extensions.DependencyInjection; using HeuristicLab.Clients.Hive.WebJobManager.Services; using Microsoft.Extensions.Configuration; using HeuristicLab.Common; using HeuristicLab.Core; namespace HeuristicLab.Clients.Hive.WebJobManager { public class Startup { private IHostingEnvironment hostingEnvironment; public Startup(IHostingEnvironment hostingEnvironment) { var builder = new ConfigurationBuilder() .AddJsonFile("conf.json") .AddEnvironmentVariables(); var config = builder.Build(); 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(); } // 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.UseMvcWithDefaultRoute(); app.UseStaticFiles(); app.UseStatusCodePages(); } // Entry point for the application. public static void Main(string[] args) => WebApplication.Run(args); } }