You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
884 B

  1. namespace AwesomeMicroservices.WebApi
  2. {
  3. public class Program
  4. {
  5. public static void Main(string[] args)
  6. {
  7. var builder = WebApplication.CreateBuilder(args);
  8. // Add services to the container.
  9. builder.Services.AddControllers();
  10. // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
  11. builder.Services.AddEndpointsApiExplorer();
  12. builder.Services.AddSwaggerGen();
  13. var app = builder.Build();
  14. // Configure the HTTP request pipeline.
  15. if (app.Environment.IsDevelopment())
  16. {
  17. app.UseSwagger();
  18. app.UseSwaggerUI();
  19. }
  20. app.UseHttpsRedirection();
  21. app.UseAuthorization();
  22. app.MapControllers();
  23. app.Run();
  24. }
  25. }
  26. }