domBudg/back/Controllers/Program.cs

33 lines
723 B
C#
Raw Normal View History

using Controllers.Extensions;
2024-11-25 13:39:48 +04:00
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
2024-11-25 20:56:39 +04:00
builder.Services.AddDbConnectionService(builder.Configuration);
builder.Services.AddRepos();
builder.Services.AddDomainServices();
2024-11-25 13:39:48 +04:00
builder.Services.AddControllers();
// 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();
app.UseSwaggerUI();
}
2024-11-25 20:56:39 +04:00
app.MigrateDb();
2024-11-25 13:39:48 +04:00
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
2024-11-25 20:56:39 +04:00
await app.RunAsync();