In my ASP 4.6 application I have:
app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "Feature Toggle API V1"); });
When I run it on localhost:5000/swagger/v1/swagger.json
it works fine but when I deploy it on a remote server that uses virtual directories for different applications someserver/myapp/swagger/v1/swagger.json
it doesn't work.
What is the best practice in turning app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "Feature Toggle API V1"); });
to a relative path that works on localhost as well as within a virtual directory?