aboutsummaryrefslogtreecommitdiff
path: root/API/Extensions/ConfigureSwagger.cs
diff options
context:
space:
mode:
Diffstat (limited to 'API/Extensions/ConfigureSwagger.cs')
-rw-r--r--API/Extensions/ConfigureSwagger.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/API/Extensions/ConfigureSwagger.cs b/API/Extensions/ConfigureSwagger.cs
new file mode 100644
index 0000000..249eca0
--- /dev/null
+++ b/API/Extensions/ConfigureSwagger.cs
@@ -0,0 +1,23 @@
+using Microsoft.AspNetCore.Builder;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.OpenApi.Models;
+
+namespace API.Extensions
+{
+ public static class SwaggerExtensions
+ {
+ public static void SwaggerConfiguration(this IServiceCollection services)
+ {
+ services.AddSwaggerGen(c =>
+ {
+ c.SwaggerDoc("v1", new OpenApiInfo { Title = "API", Version = "v1" });
+ });
+ }
+
+ public static void UseSwaggerConfiguration(this IApplicationBuilder app)
+ {
+ app.UseSwagger();
+ app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "API v1"));
+ }
+ }
+} \ No newline at end of file