How to change base url of Swagger in ASP.NET core

后端 未结 5 804
孤街浪徒
孤街浪徒 2020-12-14 07:18

By default when you enable swagger in ASP.NET Core project it\'s available on url:

http://localhost:/swagger/ui

I would

5条回答
  •  萌比男神i
    2020-12-14 07:36

    1. Open the launchSettings.json file.
    2. Under the "profiles" node depending on your setup you should have one or more profiles. In may case I had "IIS Express" and another with named with my project name (e.g WebApplication1 ), now changing the launchUrl entry to "launchUrl": "swagger" solved my problem.
    3. If this does not work and you have other profiles do the same and test.

提交回复
热议问题