Program.cs 770 B

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