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:
parent
0f5a7ee6fa
commit
9c851b0f0e
18 changed files with 189 additions and 85 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue