mirror of
https://gitea.tendokyu.moe/ppc/amnet.git
synced 2026-09-22 22:28:22 +03:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -57,6 +57,17 @@ public static class DllMain
|
||||
builder.Logging.AddFilter("Microsoft.AspNetCore.Routing.EndpointMiddleware", LogLevel.Error);
|
||||
|
||||
builder.WebHost.UseUrls(_serverAddresses);
|
||||
builder.Services.AddCors(cors =>
|
||||
{
|
||||
cors.AddDefaultPolicy(policy =>
|
||||
{
|
||||
policy.AllowAnyMethod();
|
||||
policy.AllowAnyOrigin();
|
||||
|
||||
policy.SetPreflightMaxAge(TimeSpan.FromHours(6));
|
||||
});
|
||||
});
|
||||
|
||||
builder.Services.ConfigureHttpJsonOptions(options =>
|
||||
{
|
||||
options.SerializerOptions.TypeInfoResolverChain.Insert(0, AppJsonSerializerContext.Default);
|
||||
@@ -64,6 +75,8 @@ public static class DllMain
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseCors();
|
||||
|
||||
app.MapGet("/", () => Results.Ok(new SystemState(ApiVersion, _serverName)));
|
||||
app.MapPost("/card", async ctx =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user