You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the README there is an example where a router object's add method is called with 1 argument:
users.add(function () {
// create a new user
})
However, this doesn't work:
Uncaught TypeError: Cannot read property 'replace' of undefined
at regexify (jouter.min.js:formatted:45)
at routeRe (jouter.min.js:formatted:49)
at route (jouter.min.js:formatted:53)
at Function.add (jouter.min.js:formatted:94)
at ...
Should this work or is there a mistake in the example code?
Also, what is the correct way to handle the following situation?
var rootRouter = jouter.createRouter();
var subRouter = jouter.createRouter();
rootRouter.add(router, '/mypage/...');
subRouter.add(function (x) {
// Should be called on /mypage/foo/123
// It works fine
}, '/foo/:x');
subRouter.add(function () {
// Should be called on /mypage
// ... but nothing happens
}, '/'); // I also tried '...', '/...', '*' but it doesn't work
I thought that maybe there should be no path specified (as in the example in the README), but the aforementioned error appeared.
The text was updated successfully, but these errors were encountered:
In the README there is an example where a router object's
add
method is called with 1 argument:However, this doesn't work:
Should this work or is there a mistake in the example code?
Also, what is the correct way to handle the following situation?
I thought that maybe there should be no path specified (as in the example in the README), but the aforementioned error appeared.
The text was updated successfully, but these errors were encountered: