Rewrite index to swagger page
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
5fea499da4
commit
d3c7de189b
@ -5,6 +5,7 @@ using Microsoft.Extensions.Configuration;
|
|||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
|
using Microsoft.AspNetCore.Rewrite;
|
||||||
|
|
||||||
namespace AOC2021
|
namespace AOC2021
|
||||||
{
|
{
|
||||||
@ -49,6 +50,9 @@ namespace AOC2021
|
|||||||
|
|
||||||
app.UseSwagger();
|
app.UseSwagger();
|
||||||
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "AOC2021 v1"));
|
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "AOC2021 v1"));
|
||||||
|
var option = new RewriteOptions();
|
||||||
|
option.AddRedirect("^$", "swagger");
|
||||||
|
app.UseRewriter(option); //Default to swagger
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|
||||||
@ -58,6 +62,7 @@ namespace AOC2021
|
|||||||
{
|
{
|
||||||
endpoints.MapControllers();
|
endpoints.MapControllers();
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user