ldnclj

Find us on #clojure-uk
jonpither 2016-02-23T08:08:17.000086Z

Morns

2016-02-23T09:06:09.000087Z

morgen

mccraigmccraig 2016-02-23T09:11:08.000088Z

madainn mhath

thomas 2016-02-23T09:20:42.000089Z

moin moin

jamiei 2016-02-23T09:21:05.000090Z

Morning

malcolmsparks 2016-02-23T09:34:39.000091Z

hi!

frankiesardo 2016-02-23T12:24:05.000092Z

Hey folks

frankiesardo 2016-02-23T12:24:17.000093Z

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.

frankiesardo 2016-02-23T12:24:36.000094Z

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

đź‘Ť 2
frankiesardo 2016-02-23T12:24:51.000096Z

I hope this can be your gateway drug to pedestal :simple_smile:

2016-02-23T14:56:56.000098Z

@frankie: interesting! Does that mean route specific interceptors are supported on ring?

2016-02-23T14:57:48.000099Z

(just read that it does)! But cool!

frankiesardo 2016-02-23T14:57:57.000100Z

@rickmoynihan: Thanks!

frankiesardo 2016-02-23T14:58:30.000101Z

Ring doesn’t have to do anything, tripod returns a handler and it manages its own execution flow

frankiesardo 2016-02-23T14:59:01.000102Z

This means you can use any existing middlewares globally and then apply specific interceptors as you define your routes.

2016-02-23T14:59:20.000103Z

ok - so you're basically bypassing ring (except at the toplevel)

2016-02-23T14:59:46.000104Z

makes sense - it probably can't be any other way

frankiesardo 2016-02-23T14:59:59.000105Z

Mhmh, not really, it’s just an extra layer on top of ring, like compojure, but way more extensible

2016-02-23T15:00:47.000106Z

yeah - that's basically what I meant... but what I suppose I mean is that interceptors replace some of the ring middlewares

2016-02-23T15:01:58.000109Z

ring middlewares can be quite painful

2016-02-23T15:02:54.000110Z

> On the frontend verbs make no sense. Out of interest what does this mean exactly?

frankiesardo 2016-02-23T15:03:47.000111Z

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

2016-02-23T15:04:11.000113Z

ok

2016-02-23T15:04:34.000114Z

not an issue if you're not using clojurescript then :simple_smile:

frankiesardo 2016-02-23T15:05:05.000115Z

it’s not an issue per se, it’s just a difference from the way pedestal defines route maps

2016-02-23T15:05:26.000116Z

sure - I guess I mean is it doesn't concern me :simple_smile:

frankiesardo 2016-02-23T15:06:06.000117Z

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

frankiesardo 2016-02-23T15:06:20.000118Z

(Liberator helps in this case)

2016-02-23T15:07:31.000119Z

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

frankiesardo 2016-02-23T15:10:02.000120Z

If you match the route before the verb then your handler can still return 405 instead of 404, which is more correct

2016-02-23T15:11:37.000123Z

interesting - I stand corrected - thanks! :simple_smile:

frankiesardo 2016-02-23T15:16:12.000124Z

np if you try it out feedback is greatly appreciated :thumbsup:

2016-02-23T15:19:04.000125Z

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