Apigateway/Microservicios/MsLdap/Program.cs

43 lines
1.1 KiB
C#
Raw Normal View History

2024-03-13 16:34:45 -05:00
using Microsoft.OpenApi.Models;
namespace MsLdap
{
public class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo { Title = "LDAP Api", Version = "v1" });
});
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment() || app.Environment
.IsProduction())
{
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "LDAP Api V1");
});
}
app.UseAuthorization();
app.MapControllers();
app.Run();
}
}
}