我的ASP.NET核心应用启动路径设置为:
My ASP.NET core app startup route is set as:
/api/values我想将此启动路线更改为:
I want to change this startup route to be:
/在文档中查找有关路由约束的大量规范,但我我不确定我是否知道如何设置启动时运行的路由...
Looking through the documentation there is lots of specification on route constraints but I'm not sure I see how to set the route that gets run on startup...
启动时调用了错误的控制器。如果删除控制器(ValueController),则会得到404。在运行时指定在哪里使用此控制器?
It's calling the wrong controller on startup. If I remove the controller (ValueController), I get a 404. Where is it specified to use this controller at runtime?
我在隐藏的launchSettings中看到了希望。 json但正在编辑
I'm seeing hope in the hidden launchSettings.json but editing
localhost:5000/api/value至
localhost:5000/没有帮助
推荐答案Adam Weitzman是正确的,但您也可以使用Visual Studio的GUI进行切换。
Adam Weitzman is right, but you can also switch it using Visual Studio's GUI.
更多推荐
如何在ASP.NET Core中设置启动路由
发布评论