SwaggerModule.cs 525 B

1234567891011121314151617181920
  1. namespace WebTemplate.ServerAspects.Swagger;
  2. public class SwaggerModule : IAppConfigurationModule
  3. {
  4. public void ConfigureServices(IServiceCollection services, IConfigurationRoot config)
  5. {
  6. // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
  7. services.AddEndpointsApiExplorer();
  8. services.AddSwaggerGen();
  9. }
  10. public void ConfigureApplication(WebApplication app)
  11. {
  12. if (app.Environment.IsDevelopment())
  13. {
  14. app.UseSwagger();
  15. app.UseSwaggerUI();
  16. }
  17. }
  18. }