Fork me on GitHub
#yada
<
2016-02-26
>
stijn08:02:00

yes, but I still need to migrate those endpoints from 1.0 to 1.1, so it's probably quite different (and doesn't use the multipart async upload)

mccraigmccraig09:02:23

@stijn ha, me too - 1.0 is solid and i haven't had the time yet

imre10:02:04

any public sample code I could look at?

imre10:02:17

I'm on 1.1 but don't need async

mccraigmccraig10:02:03

@imre: looking at my code now, i didn't use yada for the file-upload... i added a vanilla ring handler for that route and added the wrap-multipart-params middleware https://www.refheap.com/48f85c721c0c389d8e78835f6

mccraigmccraig10:02:13

not big, not async, and not very clever simple_smile

imre11:02:02

I'm tempted to do it using yada though

mccraigmccraig11:02:34

yeah, i'll move to using yada for file-upload when i upgrade to 1.1

malcolmsparks13:02:55

File uploads works but desperately needs docs. Juxt have a client hammering it with gatling tests. There's a glitch with the boyer moore multipart but otherwise it's solid

malcolmsparks13:02:35

@mccraigmccraig the async upload part of yada is something I think will be very valuable, but it needs a bit of time to mature.

malcolmsparks13:02:22

Wish I hadn't had to write so much code there, would have been nice to have netty devs implement more support

malcolmsparks13:02:20

Hopefully that will happen. Ideally I could rewite in java and submit to netty but i'm not familiar with the committing process

malcolmsparks13:02:53

I believe that for now yada is unique in this capability. Could ne wrong.

addywaddy13:02:04

If I want to server css using bidi and yada, is [“/public” (yada (new java.io.File “path/to/public”))] the right way to go about it? As in, so that localhost:<port>/css/styles.css works?

addywaddy13:02:21

It seems to be correct, looking at https://yada.juxt.pro/manual/010_intro.md, but I’m getting cannot treat nil as HTTP response for request to ‘’

addywaddy13:02:15

If I write the route explicitly [“/public/css/styles.css" (yada (new java.io.File "path/to/public/styles.css"))], then the stylesheet is returned.

malcolmsparks13:02:55

That error tells you bidi isn't matching anything

malcolmsparks13:02:13

Make sure your / are all corre t

malcolmsparks13:02:34

But yes, you're coding it right

addywaddy13:02:55

thanks mate - I’ll check those slashes.

malcolmsparks14:02:42

matching uris is a little too unforgiving

addywaddy14:02:02

Sorry - sure I’m missing something really simple here: `(def routes ["" ["/public/" (yada (new java.io.File "resources/public/"))]])`. Shouldn’t that match /css/foo.css if the css folder is in resources/public?

addywaddy14:02:18

I’m on [yada "1.1.0-20160225.101107-28”] and [bidi "2.0.0"]

addywaddy14:02:21

Solved! ["" [["/" (yada (new java.io.File "resources/public/"))]]]

addywaddy14:02:38

The route I was calling didn’t have the public path in it and so obviously didn’t match - makes perfect sense simple_smile

imre14:02:40

@malcolmsparks: do you happen to have an example for a file upload resource definition?

malcolmsparks15:02:16

you'll have to look in the tests

malcolmsparks15:02:36

i've got some client deadlines today so I'll give you some pointers later tonight

malcolmsparks15:02:14

@addywaddy: good to hear. I might create a #slashes slack channel to deal with bidi/yada puzzles that involve slashes...

malcolmsparks15:02:28

but yes, once you understand it, it does makes sense simple_smile

imre15:02:38

thanks, will go through the tests then

addywaddy15:02:06

Ha! Thanks mate. All this talk about slashes is making me want to go to the loo … 😉

imre16:02:51

I'm wondering what is the best to put as the schema for the file data though instead of Any: {:parameters {:form {:file schema.core/Any}}

imre16:02:01

for swagger ui to pick it up properly

malcolmsparks17:02:03

I have some code from @frankie we could borrow that enables file uploads from a swagger ui. I need to check it.

malcolmsparks17:02:54

That multipart bug I mentioned was a bug in another lib yada is using. So yada is ok, just need to hack up a boyer-moore implementation over the weekend. Small world, @mccraigmccraig already wrote one (in C I believe)

ikitommi23:02:13

the swagger uploads, there is a simple implementation in ring-swagger. Intented for ring, but shows what needs to be generated to the spec.

ikitommi23:02:14

might not be that different in yada?