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

Accept multiple middlewares in app.get #16

Merged
merged 1 commit into from
Feb 17, 2018

Conversation

kevva
Copy link
Contributor

@kevva kevva commented Feb 16, 2018

Forgot to implement this in my previous PR:s.

app.get = (path, fn) => {
get(path, send(fn));
app.get = function () {
// TODO: Use destructuring when targeting Node.js v6
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we can do:

app.get = (path, ...fns)  =>{
	for (const fn of fns) {
		get(path, send(fn));
	}
};

@coveralls
Copy link

coveralls commented Feb 16, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling d507a32 on kevva:multiple-middleware into 5788767 on lukechilds:master.

@lukechilds lukechilds merged commit 23319da into lukechilds:master Feb 17, 2018
@lukechilds
Copy link
Owner

Good catch, totally missed that too.

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.

None yet

3 participants