Morns
morgen
madainn mhath
moin moin
Morning
hi!
Hey folks
After my talk on pedestal back at Clojure Exchange quite a few people commented that they didn't want to try out Pedestal because it was an all-or-nothing framework.
Recently I've extracted the routing logic of pedestal in a self contained library that you can use with Ring and ClojureScript https://github.com/frankiesardo/tripod
I hope this can be your gateway drug to pedestal :simple_smile:
@frankie: interesting! Does that mean route specific interceptors are supported on ring?
(just read that it does)! But cool!
@rickmoynihan: Thanks!
Ring doesn’t have to do anything, tripod
returns a handler and it manages its own execution flow
This means you can use any existing middlewares globally and then apply specific interceptors as you define your routes.
ok - so you're basically bypassing ring (except at the toplevel)
makes sense - it probably can't be any other way
Mhmh, not really, it’s just an extra layer on top of ring, like compojure, but way more extensible
yeah - that's basically what I meant... but what I suppose I mean is that interceptors replace some of the ring middlewares
ring middlewares can be quite painful
> On the frontend verbs make no sense. Out of interest what does this mean exactly?
That means that on clojurescript it does make no sense to define a map with {:get get-handler :put put-handler}
because there are no verbs to route
ok
not an issue if you're not using clojurescript then :simple_smile:
it’s not an issue per se, it’s just a difference from the way pedestal defines route maps
sure - I guess I mean is it doesn't concern me :simple_smile:
if you’re using ring with tripod your handler receives all the requests for all the verbs, it’s up to you what do you respond for a Get or a Put
(Liberator helps in this case)
yeah liberator's pretty cool - but I remember reading somewhere that technically you should match VERBs before routes - can't remember why or where I read that... I know almost everyone seems to do it the other way though
If you match the route before the verb then your handler can still return 405 instead of 404, which is more correct
interesting - I stand corrected - thanks! :simple_smile:
np if you try it out feedback is greatly appreciated :thumbsup:
I've not used pedestal - but liked a lot of the ideas in it... especially route specific interceptors... So am definitely intersted in looking into it... Regarding interceptors - are there many available already? The advantage of middlewares is that there are a lot of them already written