Improve web calendar layout and shared sync state
This commit is contained in:
@@ -12,6 +12,19 @@ using Microsoft.EntityFrameworkCore;
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Services.AddOpenApi();
|
||||
builder.Services.AddCors(options =>
|
||||
{
|
||||
options.AddPolicy("CalendarWeb", policy =>
|
||||
{
|
||||
policy
|
||||
.WithOrigins(
|
||||
"https://calendar.a-web.hu",
|
||||
"http://localhost:5000",
|
||||
"http://localhost:8080")
|
||||
.AllowAnyHeader()
|
||||
.AllowAnyMethod();
|
||||
});
|
||||
});
|
||||
builder.Services.AddHttpClient("open-food-facts", client =>
|
||||
{
|
||||
client.BaseAddress = new Uri("https://world.openfoodfacts.org/");
|
||||
@@ -52,6 +65,7 @@ if (app.Environment.IsDevelopment())
|
||||
app.MapOpenApi();
|
||||
}
|
||||
|
||||
app.UseCors("CalendarWeb");
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user