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