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

Allow for multiple methods in METHOD call #32

Closed
jeremydaly opened this issue Apr 24, 2018 · 2 comments
Closed

Allow for multiple methods in METHOD call #32

jeremydaly opened this issue Apr 24, 2018 · 2 comments
Milestone

Comments

@jeremydaly
Copy link
Owner

Was thinking that you could define a route for multiple methods using an array of methods in a METHOD call. For example, api.METHOD([ 'post', 'put' ], '/some/path', (req,res)=> {})

This would be similar to the idea of an any() convenience method, but would restrict the allowable methods.

@jeremydaly jeremydaly added this to the v0.6 milestone May 2, 2018
jeremydaly added a commit that referenced this issue May 16, 2018
@jeremydaly
Copy link
Owner Author

Implemented. I'm looking the methods here, but since most instances just have 1, there should be no performance impact.

@jimsorock
Copy link
Contributor

jimsorock commented May 27, 2020

Hi Jeremy, sorry for commenting on a closed issue, but does the typescript definition to support this just need to be updated?

PR here for typescript support: #152

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