fix: compile error

This commit is contained in:
Gui.H 2023-03-23 14:29:13 +08:00
parent 632976f831
commit 749688820a
2 changed files with 5 additions and 0 deletions

View File

@ -23,6 +23,7 @@
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FastTunnel.Core\FastTunnel.Core.csproj" />
</ItemGroup>

View File

@ -48,7 +48,9 @@ public class Program
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
#if DEBUG
builder.Services.AddSwaggerGen();
#endif
builder.Services.AddCors(options =>
{
options.AddPolicy("corsPolicy", policy =>
@ -109,8 +111,10 @@ public class Program
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
#if DEBUG
app.UseSwagger();
app.UseSwaggerUI();
#endif
}
app.UseCors("corsPolicy");