Fase 1: Inicialización del Backend .NET 10, Configuración de Dapper, Autenticación JWT y Entidades Base

This commit is contained in:
2025-12-17 13:08:21 -03:00
parent 15305c681c
commit eda016f93f
33 changed files with 819 additions and 0 deletions

35
src/SIGCM.API/Program.cs Normal file
View File

@@ -0,0 +1,35 @@
using SIGCM.Infrastructure;
using SIGCM.Infrastructure.Data;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddInfrastructure();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
// Initialize DB
using (var scope = app.Services.CreateScope())
{
var initializer = scope.ServiceProvider.GetRequiredService<DbInitializer>();
await initializer.InitializeAsync();
}
app.Run();