This commit is contained in:
@@ -24,7 +24,7 @@ namespace GZTW.Pecklist
|
|||||||
.UseSetting("detailedErrors", "true")
|
.UseSetting("detailedErrors", "true")
|
||||||
.UseKestrel()
|
.UseKestrel()
|
||||||
.UseContentRoot(System.IO.Directory.GetCurrentDirectory())
|
.UseContentRoot(System.IO.Directory.GetCurrentDirectory())
|
||||||
.UseIISIntegration()
|
//.UseIISIntegration()
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
.Build();
|
.Build();
|
||||||
}
|
}
|
||||||
|
|||||||
11
Startup.cs
11
Startup.cs
@@ -4,6 +4,7 @@ using System.Linq;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.AspNetCore.HttpOverrides;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
@@ -16,6 +17,7 @@ using Microsoft.AspNetCore.Authentication.JwtBearer;
|
|||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
using Microsoft.AspNetCore.Authentication;
|
using Microsoft.AspNetCore.Authentication;
|
||||||
|
|
||||||
|
|
||||||
namespace GZTW.Pecklist
|
namespace GZTW.Pecklist
|
||||||
{
|
{
|
||||||
public class Startup
|
public class Startup
|
||||||
@@ -44,6 +46,8 @@ namespace GZTW.Pecklist
|
|||||||
|
|
||||||
services.AddMvc();
|
services.AddMvc();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//get the key from the appsettings.json file
|
//get the key from the appsettings.json file
|
||||||
var secretKey = Configuration.GetSection("JWT").GetValue<string>("secret");
|
var secretKey = Configuration.GetSection("JWT").GetValue<string>("secret");
|
||||||
var signingKey = new SymmetricSecurityKey(System.Text.Encoding.ASCII.GetBytes(secretKey));
|
var signingKey = new SymmetricSecurityKey(System.Text.Encoding.ASCII.GetBytes(secretKey));
|
||||||
@@ -85,6 +89,12 @@ namespace GZTW.Pecklist
|
|||||||
|
|
||||||
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
|
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
|
||||||
loggerFactory.AddDebug();
|
loggerFactory.AddDebug();
|
||||||
|
|
||||||
|
app.UseForwardedHeaders(new ForwardedHeadersOptions
|
||||||
|
{
|
||||||
|
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
|
||||||
|
});
|
||||||
|
|
||||||
app.UseDefaultFiles();
|
app.UseDefaultFiles();
|
||||||
app.UseStaticFiles(new StaticFileOptions
|
app.UseStaticFiles(new StaticFileOptions
|
||||||
{
|
{
|
||||||
@@ -97,6 +107,7 @@ namespace GZTW.Pecklist
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
app.UseMvc();
|
app.UseMvc();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user