Setting [Route("/")] blocks MapSpaFallbackRoute() #509

Closed
opened 2025-08-09 17:16:33 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @jamesgurung on 8/14/2017

Repro

yo aspnetcore-spa
(Select "Vue")
dotnet run

Navigating to "/counter" in the address bar correctly opens the relevant SPA route.

Now edit in HomeController.cs:

[Route("/")] // Add this line
public IActionResult Index()
{
  return View();
}
dotnet run

Navigating to "/counter" in the address bar no longer works (HTTP 404).

*Originally created by @jamesgurung on 8/14/2017* ## Repro ``` yo aspnetcore-spa (Select "Vue") dotnet run ``` Navigating to "/counter" in the address bar correctly opens the relevant SPA route. Now edit in `HomeController.cs`: ```C# [Route("/")] // Add this line public IActionResult Index() { return View(); } ``` ``` dotnet run ``` Navigating to "/counter" in the address bar no longer works (HTTP 404).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#509
No description provided.