Program.cs 621 B

1234567891011121314151617181920212223242526272829303132
  1. using trieTree.xiaoshi.sz.com;
  2. var builder = WebApplication.CreateBuilder(args);
  3. // Add services to the container.
  4. builder.Services.AddControllers();
  5. // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
  6. builder.Services.AddEndpointsApiExplorer();
  7. builder.Services.AddSwaggerGen();
  8. // 添加服务到依赖注入容器
  9. builder.Services.AddSingleton<AddressUtility>();
  10. // 配置HTTP请求管道
  11. // ...
  12. var app = builder.Build();
  13. // Configure the HTTP request pipeline.
  14. app.UseSwagger();
  15. app.UseSwaggerUI();
  16. app.UseHttpsRedirection();
  17. app.UseAuthorization();
  18. app.MapControllers();
  19. app.Run();