aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Web/Configurations/Extensions/ConfigureSwagger.cs
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2020-12-14 23:29:14 +0200
committertranstrike <transtrike@gmail.com>2020-12-14 23:29:14 +0200
commitdee2e37a4a8759108390c664e06bf147b8385cbf (patch)
treebd65fe5649731a55aa6f1d8b48d53d89032fb8be /src/DevHive.Web/Configurations/Extensions/ConfigureSwagger.cs
parent1ccdefdac025b1b986ad2bd0bc3eda7505d6e7c3 (diff)
downloadDevHive-dee2e37a4a8759108390c664e06bf147b8385cbf.tar
DevHive-dee2e37a4a8759108390c664e06bf147b8385cbf.tar.gz
DevHive-dee2e37a4a8759108390c664e06bf147b8385cbf.zip
Stabalized project for compilation. Next step after init architecture
Diffstat (limited to 'src/DevHive.Web/Configurations/Extensions/ConfigureSwagger.cs')
-rw-r--r--src/DevHive.Web/Configurations/Extensions/ConfigureSwagger.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/DevHive.Web/Configurations/Extensions/ConfigureSwagger.cs b/src/DevHive.Web/Configurations/Extensions/ConfigureSwagger.cs
new file mode 100644
index 0000000..a0641ab
--- /dev/null
+++ b/src/DevHive.Web/Configurations/Extensions/ConfigureSwagger.cs
@@ -0,0 +1,23 @@
+using Microsoft.AspNetCore.Builder;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.OpenApi.Models;
+
+namespace DevHive.Web.Configurations.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