Files
Inventario-IT/backend/Program.cs

26 lines
621 B
C#
Raw Normal View History

using Inventario.API.Data;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddSingleton<DapperContext>();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "Inventario API V1");
c.RoutePrefix = string.Empty;
});
}
app.UseHttpsRedirection();
app.MapControllers();
app.Run();