This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-11
Channels
- # announcements (1)
- # beginners (84)
- # boot (325)
- # cbus (1)
- # cider (13)
- # cljs-dev (1)
- # cljsjs (1)
- # cljsrn (15)
- # clojars (8)
- # clojure (221)
- # clojure-czech (2)
- # clojure-ireland (8)
- # clojure-madison (28)
- # clojure-poland (176)
- # clojure-russia (111)
- # clojurebridge (7)
- # clojurescript (75)
- # community-development (70)
- # conf-proposals (19)
- # core-async (29)
- # css (12)
- # cursive (66)
- # datavis (15)
- # datomic (61)
- # devcards (15)
- # dirac (2)
- # editors (13)
- # emacs (9)
- # funcool (7)
- # hoplon (13)
- # jobs-discuss (5)
- # ldnclj (39)
- # ldnproclodo (1)
- # lein-figwheel (3)
- # leiningen (21)
- # liberator (26)
- # off-topic (12)
- # om (153)
- # onyx (168)
- # parinfer (165)
- # proton (21)
- # quil (5)
- # re-frame (58)
- # reagent (4)
- # ring-swagger (12)
- # spacemacs (3)
- # yada (120)
https://github.com/juxt/yada/blob/1c983d4c3c3e427fa6bfc424992d1d50bceecb4c/manuscript/010_intro.md#say-hello-to-yada But it#s in the docs!
Looking at the source, @malcolmsparks may need to extend java.net.URL class to work as a resource (for io/resource), new-classpath-resource
is what you're after, no doubt in my mind. It's designed for EXACTLY your need. It's really cool.
micha [11:35 AM] i guess what you need is a task that makes a manifest of all the files in public [11:35] so you can add them one by one [11:35] as yada endpoints
I can make do with io/file
, just that it would be nice to be able to serve from classpath (with a single jar)
Yeah. Malcolm will probably tell us soon that it's done and we just haven't found it. 😛
For serving reaources, an example is at the of this file https://github.com/juxt/yada/blob/master/src/yada/swagger.clj
(new-classpath-resource "/foo)
Sorry, use 'foo' not '/foo'
Really? I'll look into that
Ah, did you add a additional path?
You have to add an additional path-info onto the URI, like with dire tory serving
Sorry, hands about to freeze!
Hopefully this bus will arrive soon
So if I 'mounted' my classpath resource at /foo/ I would access a resource prefix+bar with /foo/bar
Careful with those slashes!
Check the Subresources chapter
I'm in the office now, do send me some code and I'll help you figure it out. Are you using bidi btw?
In the meantime I'll check that Class/getResource thing - I'm sure it will work, although I only wrote that piece of documentation yesterday and didn't expect anyone to read it yet!
@malcolmsparks: Not a static method, and it returns slightly differently to (io/resource) based on my tests. 😛 We're all watching your commits carefully, maybe you'll have to start branching out.
Hi. I'm getting a validation error when providing handlers in my http responses. :error {:methods {:post {:responses {404 {:response disallowed-key}}}}}
(I've been having lots of fun with yada over the past couple of weeks though, of course I only ever say anything unless I think I have a bug... )
Ah, responses is just a resource-level thing right now. So you put it at the resource-level, alongside :methods
Status responses are quite new and I'm sure soon you'll be able to specify them at the method-level, for consistency if nothing else.
@fahey glad you've been having fun with yada, I hope that's both good fun and the usual frustrating 'fun' scrambling up any learning curve
The validation is to protect resource models that yada currently doesn't support - it can be painful getting past the validation step but it's worth having otherwise the code in yada would get horribly complex
Oh, thanks @malcolmsparks ! I would have stared at that for days before figuring it out, if then.
Yada seems fun to me because I can tell that the whole thing is coherent and well-thought out, so it is more like exploring something than just learning a tool.
@fahey good to hear. It's fun for me too, it's been a nice way of learning http
The validation is data, so I think perhaps it's time to publish it in some doc form
@malcolmsparks: That would be useful, especially if there were hints alongside about the coercions/shortcuts.
Yes, it needs its own chapter really, there's lots of shortforms now.
@malcolmsparks: I finally have some time to migrate from 1.0 (0.9-my-own-dev-branch) to 1.1. starting right now
@stijn Great news - that's one area I want feedback on before release 1.1 final. There is a protocol extension for allowing S3 uploads, but I think we'll need to work together one this
this is application/octetstream right? Not multipart/*
well, that was initially the case, but I think we'll be moving to multipart/* since we are adding a web client too
ok, just checking, both are supported (although I need to check that application/octetstream code - I'll do that tonight)
yes, it's a big change from 1.0->1.1. But I think you'll find it's an improvement once you get used to it
yes, the S3 extension would cope with any upload
have an S3 extension built-in would be very cool
the best resource is still examples/phonebook
I'm still trying to document everything but it's hard work and slow going
The features are pretty much done, but the docs need some work 😞
@stijn just ping me in this slack channel if you need any help or confused by anything
I tend to check-in at least twice a day