swagger goes to api too
This commit is contained in:
parent
c89a87d73c
commit
8786549e51
2 changed files with 12 additions and 5 deletions
|
|
@ -67,8 +67,11 @@ public class Program
|
|||
};
|
||||
});
|
||||
|
||||
builder.Services.AddControllers().AddJsonOptions(opts => { opts.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull; });
|
||||
|
||||
builder.Services.AddControllers().AddJsonOptions(opts =>
|
||||
{
|
||||
opts.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull;
|
||||
});
|
||||
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen(c =>
|
||||
{
|
||||
|
|
@ -101,8 +104,12 @@ public class Program
|
|||
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
app.UseSwagger(options => { options.RouteTemplate = "api/swagger/{documentName}/swagger.json"; });
|
||||
app.UseSwaggerUI(options =>
|
||||
{
|
||||
options.SwaggerEndpoint("/api/swagger/v1/swagger.json", "Survey Backend V1");
|
||||
options.RoutePrefix = "api/swagger";
|
||||
});
|
||||
}
|
||||
|
||||
app.UseMiddleware<ExceptionsMiddleware>();
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"launchUrl": "api/swagger",
|
||||
"applicationUrl": "http://localhost:5231",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue