mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Use MapSpaFallbackRoute in ReactServices and demo
This commit is contained in:
@@ -26,7 +26,8 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNet.NodeServices": "1.0.0-alpha7",
|
"Microsoft.AspNet.NodeServices": "1.0.0-alpha7",
|
||||||
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-*"
|
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-*",
|
||||||
|
"Microsoft.AspNet.SpaServices": "1.0.0-alpha7"
|
||||||
},
|
},
|
||||||
"resource": [
|
"resource": [
|
||||||
"Content/**/*"
|
"Content/**/*"
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNet.Mvc;
|
using Microsoft.AspNet.Mvc;
|
||||||
|
|
||||||
namespace ReactExample.Controllers
|
namespace ReactExample.Controllers
|
||||||
{
|
{
|
||||||
public class HomeController : Controller
|
public class HomeController : Controller
|
||||||
{
|
{
|
||||||
public IActionResult Index(int pageIndex)
|
public IActionResult Index()
|
||||||
{
|
{
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,9 +58,8 @@ namespace ReactExample
|
|||||||
// Add MVC to the request pipeline.
|
// Add MVC to the request pipeline.
|
||||||
app.UseMvc(routes =>
|
app.UseMvc(routes =>
|
||||||
{
|
{
|
||||||
routes.MapRoute(
|
routes.MapSpaFallbackRoute(
|
||||||
name: "default",
|
name: "default",
|
||||||
template: "{pageIndex?}",
|
|
||||||
defaults: new { controller="Home", action = "Index" });
|
defaults: new { controller="Home", action = "Index" });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user