Apigateway/TestApi2/Program.cs
2022-11-02 11:31:23 -05:00

29 lines
634 B
C#

using JwtAuthManager;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
builder.Services.AddCustomJwtAuthentication(); // <=========
// 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.
app.UseSwagger();
app.UseSwaggerUI();
//if (app.Environment.IsDevelopment())
//{
//}
app.UseAuthentication(); // <=========
app.UseAuthorization();
app.MapControllers();
app.Run();