0
sammyjs的新功能。我們廣泛地有兩個模塊,一個是服務器端渲染,另一個是解耦客戶端應用程序。我們已經實施了ko和sammy及其工作良好。但對於一些請求,我需要將它傳遞給服務器。 sammy有可能嗎?將請求傳遞給服務器sammyjs
Sammy(function() {
this.get(".*", function() {
var view = window.location.pathname;
if(view == "/")
appViewModel.currentView("home-page");
else if(view == "/product")
appViewModel.currentView("product-page");
else if(view == "/admin")
return false; // SSR Page
});
}).run();