Begin script abstraction
This commit is contained in:
@@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.IdentityModel.Logging;
|
||||
@@ -26,9 +27,9 @@ namespace ReallifeGamemode.DataService
|
||||
{
|
||||
private readonly ILogger<Startup> logger;
|
||||
private readonly IConfiguration configuration;
|
||||
private readonly IHostingEnvironment environment;
|
||||
private readonly IWebHostEnvironment environment;
|
||||
|
||||
public Startup(IConfiguration configuration, IHostingEnvironment environment, ILogger<Startup> logger)
|
||||
public Startup(IConfiguration configuration,IWebHostEnvironment environment, ILogger<Startup> logger)
|
||||
{
|
||||
this.configuration = configuration;
|
||||
this.environment = environment;
|
||||
@@ -122,15 +123,15 @@ namespace ReallifeGamemode.DataService
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
|
||||
{
|
||||
app.UseAuthentication();
|
||||
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
app.UseAuthentication();
|
||||
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseCors(c =>
|
||||
@@ -151,7 +152,10 @@ namespace ReallifeGamemode.DataService
|
||||
c.RouteTemplate = "doc/{documentName}.json";
|
||||
});
|
||||
|
||||
app.UseMvc();
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user