Commit a53edfdf by 钟博

swagger

parent 37a09568
...@@ -43,13 +43,16 @@ public void ConfigureServices(IServiceCollection services) ...@@ -43,13 +43,16 @@ public void ConfigureServices(IServiceCollection services)
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{ {
string swaggerJson = "/api/swagger/v1/swagger.json";
if (env.IsDevelopment()) if (env.IsDevelopment())
{ {
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
app.UseSwagger(); swaggerJson = swaggerJson.Replace("/api", "");
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "Performance.Subsidy.Api v1"));
} }
app.UseSwagger();
app.UseSwaggerUI(c => c.SwaggerEndpoint(swaggerJson, "Performance.Subsidy.Api v1"));
app.UseRouting(); app.UseRouting();
app.UseAuthorization(); app.UseAuthorization();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment