mapper class and delete old stuff
This commit is contained in:
@@ -58,6 +58,7 @@ namespace Gameboard.ShogiUI.Sockets
|
||||
var baseUrl = $"{Configuration["AppSettings:CouchDB:Url"]}/{Configuration["AppSettings:CouchDB:Database"]}/";
|
||||
c.BaseAddress = new Uri(baseUrl);
|
||||
});
|
||||
services.AddTransient<IModelMapper, ModelMapper>();
|
||||
|
||||
services
|
||||
.AddControllers()
|
||||
@@ -128,13 +129,17 @@ namespace Gameboard.ShogiUI.Sockets
|
||||
};
|
||||
});
|
||||
|
||||
// Remove default HttpClient logging.
|
||||
services.RemoveAll<IHttpMessageHandlerBuilderFilter>();
|
||||
services.AddHttpLogging(options =>
|
||||
{
|
||||
options.LoggingFields = Microsoft.AspNetCore.HttpLogging.HttpLoggingFields.Request;
|
||||
});
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ISocketService socketConnectionManager)
|
||||
{
|
||||
app.UseHttpLogging();
|
||||
|
||||
var origins = new[] {
|
||||
"http://localhost:3000", "https://localhost:3000",
|
||||
"http://127.0.0.1:3000", "https://127.0.0.1:3000",
|
||||
@@ -147,25 +152,25 @@ namespace Gameboard.ShogiUI.Sockets
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
var client = PublicClientApplicationBuilder
|
||||
.Create(Configuration["AzureAd:ClientId"])
|
||||
.WithLogging(
|
||||
(level, message, pii) =>
|
||||
{
|
||||
Console.WriteLine(message);
|
||||
},
|
||||
LogLevel.Verbose,
|
||||
true,
|
||||
true
|
||||
)
|
||||
.Build();
|
||||
//var client = PublicClientApplicationBuilder
|
||||
// .Create(Configuration["AzureAd:ClientId"])
|
||||
// .WithLogging(
|
||||
// (level, message, pii) =>
|
||||
// {
|
||||
// Console.WriteLine(message);
|
||||
// },
|
||||
// LogLevel.Verbose,
|
||||
// true,
|
||||
// true
|
||||
// )
|
||||
// .Build();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseHsts();
|
||||
}
|
||||
app
|
||||
.UseRequestResponseLogging()
|
||||
//.UseRequestResponseLogging()
|
||||
.UseCors(opt => opt.WithOrigins(origins).AllowAnyMethod().AllowAnyHeader().WithExposedHeaders("Set-Cookie").AllowCredentials())
|
||||
.UseRouting()
|
||||
.UseAuthentication()
|
||||
|
||||
Reference in New Issue
Block a user