Free cookie consent management tool by TermsFeed Policy Generator

source: branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Startup.cs @ 13714

Last change on this file since 13714 was 13689, checked in by jlodewyc, 8 years ago

#2582 Implemented uploading

File size: 2.2 KB
Line 
1using Microsoft.AspNet.Builder;
2using Microsoft.AspNet.Hosting;
3using Microsoft.Extensions.DependencyInjection;
4using HeuristicLab.Clients.Hive.WebJobManager.Services;
5using Microsoft.Extensions.Configuration;
6using HeuristicLab.Common;
7using HeuristicLab.Core;
8using HeuristicLab.PluginInfrastructure;
9
10
11namespace HeuristicLab.Clients.Hive.WebJobManager
12{
13    public class Startup
14    {
15        public IHostingEnvironment hostingEnvironment {
16            get; set; }
17        public Startup(IHostingEnvironment hostingEnvironment)
18        {
19            var builder = new ConfigurationBuilder()
20                .AddJsonFile("conf.json")
21                .AddEnvironmentVariables();
22            var config = builder.Build();
23
24            ApplicationManager.InitializeForWeb();
25
26
27            ContentManager.Initialize(new PersistenceContentManager());
28            //Console.WriteLine(""+ config.Get("configuration"));
29            this.hostingEnvironment = hostingEnvironment;
30        }
31        // This method gets called by the runtime. Use this method to add services to the container.
32        // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
33        public void ConfigureServices(IServiceCollection services)
34        {
35
36            services.AddMvc();
37            services.AddSingleton<ILoginViewModelService, LoginViewModelService>();
38            services.AddSingleton<IHiveServiceLocator, HiveServiceLocatorWebManagerService>();
39            services.AddSignalR();
40        }
41
42        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
43        public void Configure(IApplicationBuilder app)
44        {
45           
46            if (hostingEnvironment.IsDevelopment())
47                app.UseDeveloperExceptionPage();
48
49            app.UseIISPlatformHandler();
50           
51            app.UseStaticFiles();
52            app.UseSignalR();
53            app.UseStatusCodePages();
54            app.UseMvcWithDefaultRoute();
55        }
56
57
58
59        // Entry point for the application.
60        public static void Main(string[] args) => WebApplication.Run<Startup>(args);
61    }
62}
Note: See TracBrowser for help on using the repository browser.