reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
wombawomba 2020-08-27T07:32:34.038600Z

Is there a way to declare ‘wildcard’ routes, that match any method? I have a route that just routes requests to a CGI script and I’d like to avoid creating duplicate routes for every method the CGI script supports.

wegi 2020-08-27T07:36:11.039200Z

Do you mean something along the lines of "/cgi/:some-method" ?

wombawomba 2020-08-27T07:39:38.042200Z

No, I meant HTTP methods. I have a route on the form ["/cgi/*foo" {:get ..., :post ..., :put ..., :delete ..., :options ..., :patch ..., :head ...}] where every method works the exact same way (just passes the request along to the CGI script). I’d like to be able to do something like ["/cgi/*foo" {:* ...}] to avoid code duplication.

2020-08-27T07:43:53.042500Z

["/cgi/*foo" {:handler ...}]
this will catch all the methods

wombawomba 2020-08-27T07:44:44.043Z

Perfect, thanks!