Заменил Scalar на Swagger
All checks were successful
Create and publish a Docker image / Publish image (push) Successful in 5m6s
All checks were successful
Create and publish a Docker image / Publish image (push) Successful in 5m6s
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
using Microsoft.Identity.Web;
|
using Microsoft.Identity.Web;
|
||||||
using Quartz;
|
using Quartz;
|
||||||
using Scalar.AspNetCore;
|
|
||||||
using SfeduSchedule;
|
using SfeduSchedule;
|
||||||
using SfeduSchedule.Jobs;
|
using SfeduSchedule.Jobs;
|
||||||
using SfeduSchedule.Services;
|
using SfeduSchedule.Services;
|
||||||
@@ -43,10 +42,17 @@ if (string.IsNullOrEmpty(preinstsalledJwtToken))
|
|||||||
builder.Services.AddQuartzHostedService(q => q.WaitForJobsToComplete = true);
|
builder.Services.AddQuartzHostedService(q => q.WaitForJobsToComplete = true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
builder.Services.AddEndpointsApiExplorer();
|
||||||
|
builder.Services.AddSwaggerGen(options =>
|
||||||
|
{
|
||||||
|
var xmlFile = $"{System.Reflection.Assembly.GetExecutingAssembly().GetName().Name}.xml";
|
||||||
|
var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
|
||||||
|
options.IncludeXmlComments(xmlPath);
|
||||||
|
});
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
app.UseForwardedHeaders();
|
app.UseForwardedHeaders();
|
||||||
app.MapOpenApi();
|
|
||||||
|
|
||||||
var logger = app.Services.GetRequiredService<ILogger<Program>>();
|
var logger = app.Services.GetRequiredService<ILogger<Program>>();
|
||||||
|
|
||||||
@@ -90,15 +96,11 @@ if (app.Environment.IsDevelopment())
|
|||||||
{
|
{
|
||||||
app.MapOpenApi();
|
app.MapOpenApi();
|
||||||
}
|
}
|
||||||
app.MapScalarApiReference(options =>
|
|
||||||
{
|
|
||||||
options.WithTitle("Расписание занятий ЮФУ");
|
|
||||||
options.Theme = ScalarTheme.Kepler;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
app.UseSwagger();
|
||||||
|
app.UseSwaggerUI();
|
||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
|
|
||||||
|
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
|
|
||||||
app.MapGet("/", async context =>
|
app.MapGet("/", async context =>
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
<PackageReference Include="Microsoft.Identity.Web" Version="3.14.0" />
|
<PackageReference Include="Microsoft.Identity.Web" Version="3.14.0" />
|
||||||
<PackageReference Include="Microsoft.Playwright" Version="1.55.0" />
|
<PackageReference Include="Microsoft.Playwright" Version="1.55.0" />
|
||||||
<PackageReference Include="Quartz.AspNetCore" Version="3.15.0" />
|
<PackageReference Include="Quartz.AspNetCore" Version="3.15.0" />
|
||||||
<PackageReference Include="Scalar.AspNetCore" Version="2.7.2" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
Reference in New Issue
Block a user