Program.cs 565 B

12345678910111213141516171819202122232425
  1. var builder = WebApplication.CreateBuilder(args);
  2. // Add services to the container.
  3. builder.Services.AddControllers();
  4. // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
  5. builder.Services.AddEndpointsApiExplorer();
  6. builder.Services.AddSwaggerGen();
  7. builder.Services.AddHttpClient();
  8. var app = builder.Build();
  9. // Configure the HTTP request pipeline.
  10. if (app.Environment.IsDevelopment())
  11. {
  12. app.UseSwagger();
  13. app.UseSwaggerUI();
  14. }
  15. app.UseHttpsRedirection();
  16. app.UseAuthorization();
  17. app.MapControllers();
  18. app.Run();