mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-06-25 08:21:27 +00:00
Move startup & middleware classes into their own namespaces
This commit is contained in:
parent
49c22b4fab
commit
c5cc8a8782
6 changed files with 15 additions and 13 deletions
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using LBPUnion.ProjectLighthouse;
|
||||
using LBPUnion.ProjectLighthouse.Startup;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Hosting.Server.Features;
|
||||
using OpenQA.Selenium;
|
||||
|
|
|
@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
|||
using System.Xml.Serialization;
|
||||
using LBPUnion.ProjectLighthouse.Helpers;
|
||||
using LBPUnion.ProjectLighthouse.Serialization;
|
||||
using LBPUnion.ProjectLighthouse.Startup;
|
||||
using LBPUnion.ProjectLighthouse.Types;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.TestHost;
|
||||
|
|
|
@ -2,7 +2,7 @@ using System.Net;
|
|||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse;
|
||||
namespace LBPUnion.ProjectLighthouse.Helpers.Middlewares;
|
||||
|
||||
public class FakeRemoteIPAddressMiddleware
|
||||
{
|
|
@ -100,7 +100,7 @@ public static class Program
|
|||
(
|
||||
webBuilder =>
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
webBuilder.UseStartup<Startup.Startup>();
|
||||
webBuilder.UseWebRoot("StaticFiles");
|
||||
}
|
||||
)
|
||||
|
|
|
@ -14,7 +14,7 @@ using Microsoft.Extensions.Configuration;
|
|||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse;
|
||||
namespace LBPUnion.ProjectLighthouse.Startup;
|
||||
|
||||
public class Startup
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ public class Startup
|
|||
{
|
||||
services.AddControllers();
|
||||
#if DEBUG
|
||||
services.AddRazorPages().WithRazorPagesAtContentRoot().AddRazorRuntimeCompilation();
|
||||
services.AddRazorPages().WithRazorPagesAtContentRoot().AddRazorRuntimeCompilation();
|
||||
#else
|
||||
services.AddRazorPages().WithRazorPagesAtContentRoot();
|
||||
#endif
|
||||
|
@ -72,7 +72,7 @@ public class Startup
|
|||
}
|
||||
|
||||
#if DEBUG
|
||||
app.UseDeveloperExceptionPage();
|
||||
app.UseDeveloperExceptionPage();
|
||||
#endif
|
||||
|
||||
app.UseForwardedHeaders();
|
||||
|
@ -103,12 +103,12 @@ public class Startup
|
|||
);
|
||||
|
||||
#if DEBUG
|
||||
// Log post body
|
||||
if (context.Request.Method == "POST")
|
||||
{
|
||||
context.Request.Body.Position = 0;
|
||||
Logger.Log(await new StreamReader(context.Request.Body).ReadToEndAsync(), LoggerLevelHttp.Instance);
|
||||
}
|
||||
// Log post body
|
||||
if (context.Request.Method == "POST")
|
||||
{
|
||||
context.Request.Body.Position = 0;
|
||||
Logger.Log(await new StreamReader(context.Request.Body).ReadToEndAsync(), LoggerLevelHttp.Instance);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
);
|
|
@ -1,8 +1,9 @@
|
|||
using LBPUnion.ProjectLighthouse.Helpers.Middlewares;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse;
|
||||
namespace LBPUnion.ProjectLighthouse.Startup;
|
||||
|
||||
public class TestStartup : Startup
|
||||
{
|
Loading…
Add table
Add a link
Reference in a new issue