| 1234567891011121314151617181920212223242526272829303132333435 |
- using BlackRock.Reporting.API.Core;
- using BlackRock.Reporting.API.Persistence;
- using BlackRock.Reporting.API.Profiles;
-
- var builder = WebApplication.CreateBuilder(args);
-
- // Add services to the container.
- builder.Services.AddCors();
- builder.Services.AddControllers();
- builder.Services.AddAutoMapper(typeof(Profiler));
- builder.Services.AddScoped<IGenerator, PdfGenerator>();
- // 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.UseCors(options =>
- options.AllowAnyHeader()
- .AllowAnyMethod()
- .AllowAnyOrigin()
- );
- if (app.Environment.IsDevelopment())
- {
- app.UseSwagger();
- app.UseSwaggerUI();
- }
- app.UseHttpsRedirection();
-
- app.UseAuthorization();
-
- app.MapControllers();
-
- app.Run();
|