Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picker route style should be somewhat similar to FlowRouter #9

Open
smeijer opened this issue Apr 26, 2015 · 0 comments
Open

Picker route style should be somewhat similar to FlowRouter #9

smeijer opened this issue Apr 26, 2015 · 0 comments

Comments

@smeijer
Copy link

smeijer commented Apr 26, 2015

It seems to me that for example middleware is a global assignment to Picker, and there is no action parameter, but just a function as second argument to the route method.

Picker is great, and when migrating from Iron-Router to FlowRouter + Picker, it should really help if Picker felt a bit more like FlowRouter. For example:

var bodyParser = Meteor.npmRequire('body-parser');

var postRoutes = Picker.filter(function(req, res) {
  return req.method == "POST";
});

Picker.route('/post/:id', {
  middlewares: [bodyParser],
  filters: [postRoutes],
  action: function(params, req, res, next) {
    // ...
  }
});

Like I said, Picker is really great! So I'm not trying to be negative about it. Just trying to help make it feel more familiar.

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

No branches or pull requests

1 participant