Mismo que anterior Commit
This commit is contained in:
		| @@ -1,19 +1,9 @@ | ||||
| using DotNetEnv; | ||||
| using FluentMigrator.Runner; | ||||
| using Mercados.Database.Migrations; | ||||
| using Mercados.Infrastructure; | ||||
| using Mercados.Infrastructure.Persistence; | ||||
| using Mercados.Infrastructure.Persistence.Repositories; | ||||
| using DotNetEnv.Configuration; | ||||
|  | ||||
|  | ||||
| var envFilePath = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "../../../../../.env")); | ||||
|  | ||||
| // Cargamos el archivo .env desde la ruta explícita. | ||||
| if (!Env.Load(envFilePath).Any()) | ||||
| { | ||||
|     Console.WriteLine($"ADVERTENCIA: No se pudo encontrar el archivo .env en la ruta: {envFilePath}"); | ||||
| } | ||||
| using Mercados.Api.Utils; | ||||
|  | ||||
| var builder = WebApplication.CreateBuilder(args); | ||||
|  | ||||
| @@ -50,7 +40,14 @@ builder.Services | ||||
|         .ScanIn(typeof(CreateInitialTables).Assembly).For.Migrations()) | ||||
|     .AddLogging(lb => lb.AddFluentMigratorConsole()); | ||||
|  | ||||
| // Servicios del contenedor estándar (perfecto) | ||||
|  | ||||
| builder.Services.AddControllers() | ||||
|     .AddJsonOptions(options => | ||||
|     { | ||||
|         // Añadimos nuestro convertidor personalizado para manejar las fechas. | ||||
|         options.JsonSerializerOptions.Converters.Add(new UtcDateTimeConverter()); | ||||
|     }); | ||||
|  | ||||
| builder.Services.AddControllers(); | ||||
| builder.Services.AddEndpointsApiExplorer(); | ||||
| builder.Services.AddSwaggerGen(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user