mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-25 23:18:44 -07:00
Split remaining service routes
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DorkNet.Contracts\DorkNet.Contracts.csproj" />
|
||||
<ProjectReference Include="..\DorkNet.ServiceDefaults\DorkNet.ServiceDefaults.csproj" />
|
||||
<ProjectReference Include="..\DorkNet.Server\DorkNet.Server.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,37 @@
|
||||
using DorkNet.Contracts;
|
||||
using DorkNet.ServiceDefaults;
|
||||
using DorkNet.Server.Startup;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Configuration.AddJsonFile("appsettings.Local.json",
|
||||
optional: true, reloadOnChange: true);
|
||||
|
||||
builder.AddDorkNetServiceDefaults(ServiceNames.Moderation);
|
||||
builder.AddDorkNetServices();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
await app.RunDatabaseBootstrapAsync();
|
||||
app.MapDorkNetServiceDefaults(mapPublicHealth: false);
|
||||
app.MapGet("/internal/moderation/capabilities", () =>
|
||||
Results.Ok(new ServiceCapabilityResponse(
|
||||
ServiceNames.Moderation,
|
||||
[
|
||||
"bug-reporting",
|
||||
"player-reporting",
|
||||
"sanitize",
|
||||
"admin-api",
|
||||
"testcase-management",
|
||||
],
|
||||
[
|
||||
"/api/bugreporting/*",
|
||||
"/api/playerreporting/*",
|
||||
"/api/sanitize/*",
|
||||
"/api/admin/*",
|
||||
"/api/testcasemanagement/*",
|
||||
])));
|
||||
|
||||
app.UseDorkNetRouteOwnershipGuard(ServiceNames.Moderation);
|
||||
app.UseDorkNetPipeline();
|
||||
|
||||
app.Run();
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user