c# - How to change base url of Swagger in ASP.NET core -
by default when enable swagger in asp.net core project it's available on url:
http://localhost:<random_port>/swagger/ui
i use different base url instead of /swagger/ui
. how/where can configure that?
i found older versions can configure rooturl
there aren't similiar method in asp.net core:
.enableswagger(c => { c.rooturl(req => mycustombasepath); });
the useswaggerui()
extension method enable middleware in configure method of startup class takes 2 variables. baseroute
on swagger/ui
default, , swaggerurl
on swagger/v1/swagger.json
default. provide different baseroute.
//swagger available under '/api' url app.useswaggerui("api");
if people learn more configuring swagger asp.net core, i've written blogpost started: https://dannyvanderkraan.wordpress.com/2016/09/09/asp-net-core-1-0-web-api-automatic-documentation-with-swagger-and-swashbuckle/
Comments
Post a Comment