Closed dodyg closed 5 years ago
And if I change the controller to the following
public class HomeControler : Controller
{
[HttpGet("/")]
[HttpGet("[controller]")]
[HttpGet("[action]")]
public ActionResult Index()
{
return new ContentResult
{
Content = @"
<html><body>
<b>Hello World running on Endpoint Routing</b>
<br/><br/>
<li><a href=""/"">/</a></li>
<li><a href=""/home"">/home</a></li>
<li><a href=""/home/index"">/home/index</a></li>
</ul>
</body></html>",
ContentType = "text/html"
};
}
}
It will work on http://localhost:5000/
, http://localhost:5000/index
but not http://localhost:5000/home
.
Could this be because you've misspelled "Controller" in HomeControler
?
Yep. It's that.
ha..ha..thanks.
This is the resulting log
for
http://localhost:5000
request.The source code is as follows
This code is so basic I don't see what could be the problem.