Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Fallthrough #2

Open
Rich-Harris opened this issue Mar 22, 2015 · 0 comments
Open

Fallthrough #2

Rich-Harris opened this issue Mar 22, 2015 · 0 comments

Comments

@Rich-Harris
Copy link
Owner

page.js has a fallthrough mechanism, which does two things - it allows separation of concerns...

// `load` is passed a `next` function, which it calls once the user is loaded
page('/user/*', load);

// for both of these routes, the user will be loaded before the route handler is called
page('/user/:user', show);
page('/user/:user/edit', edit);

...and a way to handle routes that don't match anything:

page('*', function(){
  $('body').text('Not found!');
});

Would be neat to have something similar in roadtrip eventually.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant