feat: add frontend dashboard

This commit is contained in:
2026-01-28 19:55:53 -05:00
parent e6b73a330f
commit abf7968911
21 changed files with 4523 additions and 148 deletions

View File

@@ -11,6 +11,21 @@ using Microsoft.IdentityModel.Tokens;
var builder = WebApplication.CreateBuilder(args);
// Add cors
if (builder.Environment.IsDevelopment())
{
builder.Services.AddCors(options =>
{
options.AddDefaultPolicy(policy =>
{
policy.SetIsOriginAllowed(origin => new Uri(origin).IsLoopback)
.AllowAnyHeader()
.AllowAnyMethod();
});
});
}
// Add services to the container.
builder.Services.AddDbContext<AppDbContext>(options =>
options.UseNpgsql(builder.Configuration.GetConnectionString("PostgresConnection")));
@@ -46,15 +61,14 @@ builder.Services.AddOpenApi();
var app = builder.Build();
app.UseCors();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.MapOpenApi().CacheOutput();
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/openapi/v1.json", "v1");
});
app.UseSwaggerUI(options => { options.SwaggerEndpoint("/openapi/v1.json", "v1"); });
}
app.UseHttpsRedirection();
@@ -64,4 +78,4 @@ app.UseAuthorization();
app.UseFastEndpoints();
app.Run();
app.Run();