Skip to content

Picker route style should be somewhat similar to FlowRouter #9

Open
@smeijer

Description

@smeijer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions