Fork me on GitHub
#yada
<
2015-11-09
>
tangrammer10:11:52

Hi yada guys, good te see movement over here too

mitchelkuijpers10:11:56

Is there a recommended way to serve files from the classpath? calling (yada (-> "public/" io/resource io/file)) got me a very neat error message that this is not supported yet

mitchelkuijpers10:11:47

I tried using (->ResourcesMaybe) from bidi but that fails as soon as I create a uberjar it seems to not call io/file on the assets

tangrammer10:11:25

Hi @mitchelkuijpers , in yada/dev/yada/dev/console.clj there is some examples to serve html or js (-> "cljsjs/react/production/react.min.inc.js" io/resource yada)

mitchelkuijpers10:11:58

Aha I will look there thnx @tangrammer

tangrammer10:11:10

👍 BTW: file_resource.clj seems to be implemented too src/yada.resources.file_resource.clj

mitchelkuijpers10:11:41

fixed by using ["/public/" (bidi/resources {:prefix "public/"})] I think I was doing something wrong earlier

mitchelkuijpers11:11:32

A single resource works perfectly with yada but folders are not implemented yet ^^

malcolmsparks12:11:13

@mitchelkuijpers @tangrammer yes, use bidi's bidi/resources for now - but directory serving does work on master, see dev/src/yada/dev/talks.clj for example - I use it for my talks

malcolmsparks13:11:18

The plan is to deprecate bidi's inferior resource/file directory serving and replace with yada's - because yada's will also support conditional requests, content negotiation and lots of other http features out-of-the-box

malcolmsparks13:11:16

bidi's are really just a placeholder because bidi isn't really designed for this - it's primarily a URI router

mitchelkuijpers13:11:23

Aha I see, this is perfectly fine for now. Really liking Yada I tried the 0.4.3 version a whole while back but I am reconsidering Yada, really liking the approach with protocols

mitchelkuijpers13:11:27

seems very extensible

stijn14:11:23

there you go @malcolmsparks another +1 for the protocols 😄

tangrammer14:11:23

@stijn: I'm a protocol fan too , but I have more problems with defrecords (as common way to impl protocols) due that for me they are more closed that they should simple_smile ...