Fork me on GitHub
#yada
<
2016-11-01
>
kingoftheknoll03:11:26

For anyone else wondering the same question, you can just use a normal handler function to a Bidi route and works like charm.

malcolmsparks09:11:45

Bidi isn't tied to yada, you can out any Ring compatible thing in there

jeroenvandijk10:11:46

@kingoftheknoll And you can also mount yada under compojure 🙂

kingoftheknoll19:11:54

@malcolmsparks got a question about bidi if you don’t mind. Wondering how I can make a rule that will match all routes starting at a base url. I’m going to use aleph to proxy traffic to an old webserver. So like /v2 is the base therefore match all of these /v2/foo/bar, /v2/very/long/url. I know that yada has something like this with path-info? but I’d like to handle this with a plain Aleph handler.

dominicm20:11:13

@kingoftheknoll it's something to do with implementing a path matched protocol from bidi. Hopefully matched will turn it up if you grep for it in the yada codebase

kingoftheknoll20:11:33

honestly it looks like using the bidi catch all would be the cleanest way [true handler-fn]

dominicm21:11:40

https://github.com/juxt/bidi/blob/master/src/bidi/ring.clj Resources maybe, just remembered about this example

dominicm21:11:48

Sorry, ResourcesMaybe