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

Pedestal's router should be verb-neutral #443

Closed
ohpauleez opened this issue Jun 8, 2016 · 1 comment
Closed

Pedestal's router should be verb-neutral #443

ohpauleez opened this issue Jun 8, 2016 · 1 comment

Comments

@ohpauleez
Copy link
Member

ohpauleez commented Jun 8, 2016

Problem: The route and router are hard-coded to HTTP verbs. This prevents the module from being used on other (similar) protocols, where it would be advantageous to do so. It also prevents the router from doing pure-path routing, where verbs don't make sense.

Proposed Solution:
In the new module refactor, route emerged as a standalone module.

Going forward, its namespace should be changed from io.pedestal.http.route.* to just io.pedestal.route.*, and the routers should be updated to be passed the "acceptable verb-set" as an argument in their creation.

This would allow the routers to be used for other protocols, common in service-to-service communication.

@ohpauleez ohpauleez added this to the Future milestone Jun 8, 2016
@ohpauleez ohpauleez changed the title Pedestal's routter should be verb-neutral Pedestal's router should be verb-neutral Jun 8, 2016
@ohpauleez
Copy link
Member Author

This is now on master -- many thanks to @timewald for doing the leg work to dive back into this.

All routers are verb neutral (they'll work with any verb - verb comparison is made with the :request-method of a request map). The Table/Tabular route definition is the only route definition that currently supports pluggable/parameterized verbs. You can pass in your :verbs set via the options map.

There are some utilities that may not work with custom verbs. If you hit one of those, please open up a new issue.

The router and route definition namespaces may be adjusted in a future release (since they are no longer http specific.

Please see the verb-neutral route tests for examples.

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

1 participant