Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 13656 was 13656, checked in by ascheibe, 8 years ago

#2582 created branch for Hive Web Job Manager

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