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

Convenience API to assign middleware to multiple route paths #175

Closed
kristianmandrup opened this issue Sep 15, 2015 · 0 comments
Closed

Comments

@kristianmandrup
Copy link

Apparently, Express allowed use with an array of paths as first argument, as a convenience to apply a given middleware to a set of paths. Why not allow the same here?

router.use(paths, mw)

My current workaround...

      var urls = Array.isArray(url) ? url : [url];
      for (let url of urls) {
        router.use(url, mw);
      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants