ukayani / restify-router

A router interface for restify that lets you aggregate route definitions and apply to a restify server
MIT License
52 stars 15 forks source link

Support object as first argument when defining methods for a Route #13

Closed dsalin closed 7 years ago

dsalin commented 7 years ago

Currently, a string is used as first argument to any Route method (get, put, post, etc.) This prevents us from supplying version and other parameters to a route (or at least I have not found a way in current version of restify-router).

Please, add this feature or tell me if you encourage PRs. I'll try to do my best in this case :)

ukayani commented 7 years ago

Hi @dsalin . PRs are definitely welcome :) If not, i'll look into making the change.

ukayani commented 7 years ago

Actually, @dsalin after further looking at your comment. I believe we do support this behavior

See the following test case

In general, the interface is meant to be identical to that of restify server. So whatever you can do on that for route registration should be possible here.

Hope that helps.

dsalin commented 7 years ago

Thank you very much @ukayani. Yes, this is what I was looking for.