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

Support specifying explicit endpoint path for middleware instance #75

Closed
wants to merge 6 commits into from

Conversation

kibertoad
Copy link
Collaborator

fixes #36
fixes #62

I would suggest reviewing #74 separately and first, since this once builds on what that PR introduces, but alternatively everything can be reviewed within this PR - it's a superset of #74.

@kibertoad kibertoad requested review from kobik and idanto June 25, 2019 15:44
@coveralls
Copy link

coveralls commented Jun 25, 2019

Coverage Status

Coverage decreased (-0.8%) to 98.291% when pulling 3c0d3a3 on feature/36-support-explicit-routes into a5f76cc on master.

@kobik
Copy link
Collaborator

kobik commented Jun 30, 2019

@kibertoad, i thought you wanted something to control the route through the middleware. like this

app.post("/echo", validator.validate("post", "/echo"), (req, res, next) => {
  res.json({ output: req.body.input });
});

btw, you'd only need to pass the request, as the middleware has access to the request method from req, so it would look like this.

app.post("/echo", validator.validate({route: "/echo"}), (req, res, next) => {
  res.json({ output: req.body.input });
});

anyway, as with this change we'll need a validate function that returns validate middleware so it could receive the configuration, this would be a breaking change.

@kibertoad
Copy link
Collaborator Author

@kobik Fair point. Can we postpone it till 2.0.0 then? It's not really that high priority feature for me, I'd much rather #69 landed faster.

@kobik
Copy link
Collaborator

kobik commented Jul 5, 2019

@kibertoad I have no problem with that

@kibertoad
Copy link
Collaborator Author

@kobik Is everything ready for 1.0.0 then?

@kobik
Copy link
Collaborator

kobik commented Sep 5, 2019

@kibertoad i think we should close this MR for now and until we agree on how we solve it.

@kibertoad
Copy link
Collaborator Author

@kobik Makes sense :)

@kibertoad kibertoad closed this Sep 7, 2019
@idanto idanto deleted the feature/36-support-explicit-routes branch March 11, 2020 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Passing explicit path to middleware instance More flexible path resolution with regards to path parameters
3 participants