Organize middlewares

This commit is contained in:
jvyden 2022-05-15 10:31:45 -04:00
parent 2e8c59a16f
commit 08be90aadc
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
5 changed files with 10 additions and 6 deletions

View file

@ -1,6 +1,5 @@
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Middlewares;
using LBPUnion.ProjectLighthouse.Serialization;
using LBPUnion.ProjectLighthouse.Startup.Middlewares;
using Microsoft.OpenApi.Models;
namespace LBPUnion.ProjectLighthouse.Servers.API.Startup;

View file

@ -1,7 +1,7 @@
using LBPUnion.ProjectLighthouse.Helpers;
using LBPUnion.ProjectLighthouse.Logging;
using LBPUnion.ProjectLighthouse.Middlewares;
using LBPUnion.ProjectLighthouse.Serialization;
using LBPUnion.ProjectLighthouse.Startup.Middlewares;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Settings;
using Microsoft.AspNetCore.HttpOverrides;

View file

@ -1,5 +1,5 @@
using LBPUnion.ProjectLighthouse.Middlewares;
using LBPUnion.ProjectLighthouse.Startup;
using LBPUnion.ProjectLighthouse.Startup.Middlewares;
using Microsoft.AspNetCore.HttpOverrides;
namespace LBPUnion.ProjectLighthouse.Servers.Website.Startup;

View file

@ -4,7 +4,7 @@ using System.Threading.Tasks;
using LBPUnion.ProjectLighthouse.Logging;
using Microsoft.AspNetCore.Http;
namespace LBPUnion.ProjectLighthouse.Startup.Middlewares;
namespace LBPUnion.ProjectLighthouse.Middlewares;
public class RequestLogMiddleware
{
@ -28,7 +28,7 @@ public class RequestLogMiddleware
// Log all headers.
// foreach (KeyValuePair<string, StringValues> header in context.Request.Headers) Logger.Log($"{header.Key}: {header.Value}");
await next(context); // Handle the request so we can get the status code from it
await this.next(context); // Handle the request so we can get the status code from it
requestStopwatch.Stop();

View file

@ -20,6 +20,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.1"/>
<PackageReference Include="Redis.OM" Version="0.1.9"/>
<PackageReference Include="SharpZipLib" Version="1.3.3"/>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.1"/>
<PackageReference Include="YamlDotNet" Version="11.2.1"/>
@ -52,6 +53,10 @@
<Compile Remove="Extensions\SerializationExtensions.cs"/>
</ItemGroup>
<ItemGroup>
<Folder Include="Startup\Middlewares"/>
</ItemGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="git describe --long --always --dirty --exclude=\* --abbrev=8 &gt; &quot;$(ProjectDir)/gitVersion.txt&quot;"/>
<Exec Command="git branch --show-current &gt; &quot;$(ProjectDir)/gitBranch.txt&quot;"/>