| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using BlackRock.Reporting.API.Core;
- using BlackRock.Reporting.API.Persistence;
- using AutoMapper;
- 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>();
- builder.Services.AddSwaggerGen(c =>
- {
- c.SwaggerDoc("v1", new() { Title = "BlackRock.Reporting.API", Version = "v1" });
- });
-
- var app = builder.Build();
-
- // Configure the HTTP request pipeline.
-
- app.UseCors(options =>
- options.AllowAnyHeader()
- .AllowAnyMethod()
- .AllowAnyOrigin()
- );
- if (app.Environment.IsDevelopment())
- {
- app.UseSwagger();
- app.UseSwaggerUI(c => {
- c.SwaggerEndpoint("/swagger/v1/swagger.json", "BlackRock.Reporting.API v1");
- c.RoutePrefix = string.Empty;});
- }
-
- app.UseHttpsRedirection();
-
- app.UseAuthorization();
-
- app.MapControllers();
-
- app.Run();
|