我的ASP.NET核心应用启动路由设置为:
/api/values
我想将此启动路由更改为:
/
查看文档有很多关于路由约束的规范,但我不确定如何设置在启动时运行的路由...
它在启动时调用错误的控制器。如果我删除控制器(ValueController),我得到一个404.它指定在运行时使用该控制器在哪里?
我在隐藏的launchSettings.json中看到了希望,但正在编辑
http://localhost:5000/api/value
到
http://localhost:5000/
无效
答案 0 :(得分:10)
Adam Weitzman是对的,但您也可以使用Visual Studio的GUI切换它。
答案 1 :(得分:1)
它位于Properties/launchSettings.json
要改变的领域是:
profiles.IISExpress.launchUrl