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

Fix issue when several routes match current path #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gsabran
Copy link

@gsabran gsabran commented Jun 1, 2016

Currently, doing:

Picker.route('somePath', (params, req, res, next) => {
  if (req.method == 'POST') {
     ...
  } else { next(); }
});
Picker.route('somePath', (params, req, res, next) => {
  if (req.method == 'GET') {
     ...
  } else { next(); }
});

will not reach the GET route if the request is GET somePath.
For any other example where several route definitions match the current path, calling next will not go to the next definition.

If you accept the PR, it's be good to update picker's version and the dependency in flow-router-ssr at https://github.com/kadirahq/flow-router/blob/ssr/package.js#L61

Currently, doing:

```javascript
Picker.route('somePath', (params, req, res, next) => {
  if (req.method == 'POST') {
     ...
  } else { next(); }
});
Picker.route('somePath', (params, req, res, next) => {
  if (req.method == 'GET') {
     ...
  } else { next(); }
});
```

will not reach the GET route if the request is `GET somePath`. If you accept the PR, it's be good to update picker's version and the dependency in flow-router-ssr at https://github.com/kadirahq/flow-router/blob/ssr/package.js#L61
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

Successfully merging this pull request may close these issues.

1 participant