How to change https://<your-url>/swagger to custom in Swagger

余生长醉 提交于 2020-08-06 12:16:48

问题


I was tasked to install Swagger into Web API project.

Installed: most recent version of Swashbuckle from nuget. (Swashbuckle.Core.Net45 and Swashbuckle.Net45)

Customized: App_Start\SwaggerConfig.cs. I was able to customize (change styles, added logo, modified descriptions)..

Now we need to change from https://[your-url]/swagger to https://[your-url]/help

Please advise


回答1:


Change routePrefix of SwaggerUIOptions parameter, default is "swagger"




回答2:


How about following the documentation? In your case you could change the SwaggerConfig to

httpConfiguration
    .EnableSwaggerUi("help/{*assetPath}");

The documentation can then be found at https://[your-url]/help/index



来源:https://stackoverflow.com/questions/36944432/how-to-change-https-your-url-swagger-to-custom-in-swagger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!