Skip to content

Commit 78efc77

Browse files
Use MapSpaFallbackRoute in ReactServices and demo
1 parent d4f04d2 commit 78efc77

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

Microsoft.AspNet.ReactServices/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
},
2727
"dependencies": {
2828
"Microsoft.AspNet.NodeServices": "1.0.0-alpha7",
29-
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-*"
29+
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-*",
30+
"Microsoft.AspNet.SpaServices": "1.0.0-alpha7"
3031
},
3132
"resource": [
3233
"Content/**/*"

samples/react/ReactGrid/Controllers/HomeController.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
using System.Threading.Tasks;
21
using Microsoft.AspNet.Mvc;
32

43
namespace ReactExample.Controllers
54
{
65
public class HomeController : Controller
76
{
8-
public IActionResult Index(int pageIndex)
7+
public IActionResult Index()
98
{
109
return View();
1110
}

samples/react/ReactGrid/Startup.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
5858
// Add MVC to the request pipeline.
5959
app.UseMvc(routes =>
6060
{
61-
routes.MapRoute(
61+
routes.MapSpaFallbackRoute(
6262
name: "default",
63-
template: "{pageIndex?}",
6463
defaults: new { controller="Home", action = "Index" });
6564
});
6665
}

0 commit comments

Comments
 (0)