using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; using Scalar.AspNetCore; using Trazo.Model; var builder = WebApplication.CreateBuilder(args); builder.Services.AddControllers(); // Add services to the container. builder.Services.AddAuthorization(); builder.Services.AddAuthentication().AddCookie(IdentityConstants.ApplicationScheme); builder.Services.AddIdentityCore() .AddEntityFrameworkStores() .AddApiEndpoints(); builder.Services.AddDbContext(options => options.UseNpgsql(builder.Configuration.GetConnectionString("Database"))); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseSwagger(options => { options.RouteTemplate = "openapi/{documentName}.json"; }); app.MapScalarApiReference(); } app.MapIdentityApi(); app.UseAuthorization(); app.MapControllers(); app.Run();