NonInventPurchasingSystem/CPRNIMS.WebApi/Program.cs
2026-04-21 11:59:21 +08:00

40 lines
890 B
C#

using CPRNIMS.Domain.Profile.Canvass;
using CPRNIMS.Middleware;
using CPRNIMS.WebApi.Common;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddApplicationServices(builder);
builder.Services.AddAutoMapper(cfg => { }, typeof(SupplierRequestProfile));
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("./v2/swagger.json", "LLOYD API V2"); //originally "./swagger/v1/swagger.json"
});
}
app.UseMiddleware<GlobalExceptionMiddleware>();
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("./v2/swagger.json", "LLOYD API V2"); //originally "./swagger/v1/swagger.json"
});
app.UseCors("AllowAnyOrigin");
app.UseHttpsRedirection();
app.UseAuthentication();
app.UseAuthorization();
app.MapControllers();
app.Run();