Demo
window._router = Ruut([ function (route) { console.log("This is the home page.", route); return "This is the home page" } , { ":user": ["user-profile", { ":project": { "build": "build" , "editor": [null, {}, "editor_file" ] } }] , "blog": ["Blog homepage", { "page": { ":page": "Blog page" } , ":article": ["Blog article", { "comments": ["comments", { ":id": "Current comment" }] }] }] // Route: /signup , "signup": "Sign up route" , "users": ["Users list", { ":user": "User profile" }] } ]);