feat: get web app talking to api
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user