NonInventPurchasingSystem/CPRNIMS.WebApi/Program.cs

43 lines
865 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.AddFastReport();
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");
});
}
app.UseMiddleware<GlobalExceptionMiddleware>();
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("./v2/swagger.json", "LLOYD API V2");
});
app.UseCors("AllowAnyOrigin");
app.UseHttpsRedirection();
app.UseFastReport();
app.UseAuthentication();
app.UseAuthorization();
app.MapControllers();
app.Run();