()
.Build();
+ return host;
+ }
}
}
diff --git a/src/isnd/Startup.cs b/src/isnd/Startup.cs
index 2441cd0..eafa792 100644
--- a/src/isnd/Startup.cs
+++ b/src/isnd/Startup.cs
@@ -17,6 +17,8 @@ using Unleash;
using Microsoft.Extensions.Options;
using isnd.Helpers;
using Microsoft.IdentityModel.Tokens;
+using System;
+using Microsoft.OpenApi.Models;
namespace isnd
{
@@ -93,6 +95,24 @@ namespace isnd
ValidateAudience = false
};
});
+ services.AddSwaggerGen(options =>
+ options.SwaggerDoc("v1", new OpenApiInfo
+ {
+ Version = "v1",
+ Title = "ToDo API",
+ Description = "An ASP.NET Core Web API for managing ToDo items",
+ TermsOfService = new Uri("https://isn.pschneider.fr/terms"),
+ Contact = new OpenApiContact
+ {
+ Name = "Example Contact",
+ Url = new Uri("https://isn.pschneider.fr/contact")
+ },
+ License = new OpenApiLicense
+ {
+ Name = "Example License",
+ Url = new Uri("https://isn.pschneider.fr/license")
+ }
+ }));
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
@@ -104,6 +124,8 @@ namespace isnd
{
app.UseDeveloperExceptionPage();
app.UseMigrationsEndPoint();
+ app.UseSwagger();
+ app.UseSwaggerUI();
}
else
{
diff --git a/src/isnd/Views/Home/About.cshtml b/src/isnd/Views/Home/About.cshtml
index d6c9ce5..c1b5d0e 100644
--- a/src/isnd/Views/Home/About.cshtml
+++ b/src/isnd/Views/Home/About.cshtml
@@ -5,3 +5,4 @@
@ViewData["Message"]
Use this area to provide additional information.
+
diff --git a/src/isnd/isnd.csproj b/src/isnd/isnd.csproj
index 8debd22..2aeb0d3 100644
--- a/src/isnd/isnd.csproj
+++ b/src/isnd/isnd.csproj
@@ -29,6 +29,7 @@
+