Directory Picker Rework (#1325)

* Started on the directory picker refactor.

* Coded some basic working version. Needs styling and variable cleanup

* code cleanup

* Implemented the ability to expose swagger on non-development servers.

* Implemented the ability to expose swagger on non-development servers.
This commit is contained in:
Joseph Milazzo 2022-06-16 12:08:09 -05:00 committed by GitHub
parent 0f5a7ee6fa
commit 9c851b0f0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 189 additions and 85 deletions

View file

@ -176,13 +176,23 @@ namespace API
app.UseMiddleware<ExceptionMiddleware>();
Task.Run(async () =>
{
var allowSwaggerUi = (await unitOfWork.SettingsRepository.GetSettingsDtoAsync())
.EnableSwaggerUi;
if (env.IsDevelopment() || allowSwaggerUi)
{
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "Kavita API " + BuildInfo.Version);
});
}
});
if (env.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "Kavita API " + BuildInfo.Version);
});
app.UseHangfireDashboard();
}