Begin script abstraction
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
|
||||
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -18,21 +19,15 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="log4net" Version="2.0.8" />
|
||||
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.11" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.1.11" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="2.2.12" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc2" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ItemGroup>
|
||||
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.4" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -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