This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-26
Channels
- # aatree (1)
- # admin-announcements (1)
- # beginners (84)
- # boot (239)
- # braid-chat (5)
- # braveandtrue (20)
- # cider (42)
- # cljsjs (4)
- # cljsrn (31)
- # clojars (18)
- # clojure (101)
- # clojure-austin (1)
- # clojure-gamedev (4)
- # clojure-madison (2)
- # clojure-poland (30)
- # clojure-russia (37)
- # clojurescript (95)
- # core-async (7)
- # cryogen (1)
- # css (3)
- # cursive (14)
- # datomic (8)
- # devcards (7)
- # dirac (2)
- # editors (2)
- # emacs (2)
- # funcool (1)
- # hoplon (15)
- # immutant (30)
- # ldnclj (37)
- # lein-figwheel (6)
- # leiningen (8)
- # luminus (5)
- # mount (1)
- # off-topic (59)
- # om (325)
- # om-next (7)
- # onyx (95)
- # parinfer (162)
- # proton (1)
- # re-frame (4)
- # reagent (23)
- # slack-help (4)
- # yada (43)
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)
@stijn ha, me too - 1.0 is solid and i haven't had the time yet
@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
not big, not async, and not very clever
yeah, i'll move to using yada for file-upload when i upgrade to 1.1
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
@mccraigmccraig the async upload part of yada is something I think will be very valuable, but it needs a bit of time to mature.
Wish I hadn't had to write so much code there, would have been nice to have netty devs implement more support
Hopefully that will happen. Ideally I could rewite in java and submit to netty but i'm not familiar with the committing process
I believe that for now yada is unique in this capability. Could ne wrong.
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?
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 ‘’
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.
/public/
That error tells you bidi isn't matching anything
Make sure your / are all corre t
But yes, you're coding it right
matching uris is a little too unforgiving
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?
The route I was calling didn’t have the public path in it and so obviously didn’t match - makes perfect sense
@malcolmsparks: do you happen to have an example for a file upload resource definition?
you'll have to look in the tests
i've got some client deadlines today so I'll give you some pointers later tonight
@addywaddy: good to hear. I might create a #slashes slack channel to deal with bidi/yada puzzles that involve slashes...
but yes, once you understand it, it does makes sense
Ha! Thanks mate. All this talk about slashes is making me want to go to the loo … 😉
Looks like this works for the file upload: https://gist.github.com/imrekoszo/b99cf6a253ef0b82be32
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}}
I have some code from @frankie we could borrow that enables file uploads from a swagger ui. I need to check it.
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)