feat: get web app talking to api

This commit is contained in:
Stevan Freeborn
2025-04-06 23:23:21 -05:00
parent 5652fee422
commit 3e7e6323c2
11 changed files with 146 additions and 10 deletions
+17
View File
@@ -45,6 +45,21 @@ builder.Services.AddRateLimiter(
}
);
// TODO: Make CORS more restrictive
// only allow requests from the web
// client
const string corsPolicyName = "cors";
builder.Services.AddCors(o =>
{
o.AddPolicy(corsPolicyName, p =>
{
p.AllowAnyOrigin()
.AllowAnyOrigin()
.AllowAnyMethod();
});
});
var app = builder.Build();
if (app.Environment.IsDevelopment())
@@ -57,6 +72,8 @@ if (app.Environment.IsProduction())
app.UseRateLimiter();
}
app.UseCors(corsPolicyName);
app.UseHttpsRedirection();
app.UseStatusCodePages();