1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Threading.Tasks;
|
---|
5 | using Microsoft.AspNet.Builder;
|
---|
6 | using Microsoft.AspNet.Hosting;
|
---|
7 | using Microsoft.AspNet.Http;
|
---|
8 | using Microsoft.Extensions.DependencyInjection;
|
---|
9 | using HeuristicLab.Clients.Hive.WebJobManager.Services;
|
---|
10 | using Microsoft.Extensions.Configuration;
|
---|
11 | using HeuristicLab.Common;
|
---|
12 | using HeuristicLab.Core;
|
---|
13 |
|
---|
14 | namespace 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 | }
|
---|