This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-04
Channels
- # aatree (5)
- # admin-announcements (37)
- # alda (1)
- # announcements (4)
- # architecture (1)
- # aws (3)
- # beginners (82)
- # boot (230)
- # braid-chat (14)
- # cider (48)
- # cljs-dev (8)
- # cljsrn (31)
- # clojars (47)
- # clojure (72)
- # clojure-austin (2)
- # clojure-russia (396)
- # clojurescript (72)
- # community-development (3)
- # component (6)
- # core-async (6)
- # cursive (26)
- # datomic (42)
- # emacs (6)
- # events (35)
- # hoplon (57)
- # immutant (3)
- # jobs (2)
- # jobs-discuss (10)
- # ldnclj (16)
- # luminus (2)
- # off-topic (50)
- # om (181)
- # parinfer (285)
- # proton (68)
- # re-frame (19)
- # reagent (2)
- # ring-swagger (23)
- # yada (36)
Hello, is there an easy way to make a yada resource allow all methods? That is without having to specify them individually.
@lsnape: not yet, i'm considering it
because of the 404 case, actually
It’s not obvious how one would override the response, however. It’s fine for my purposes now though
I think sending a POST request to (yada nil)
will return a 405 rather than a 404, which I didn't expect
"The 404 (Not Found) status code indicates that the origin server did not find a current representation for the target resource" from RFC 7231
So 404 could mean 'you can post/put to me, but I don't currently have a representation' OR there is no resource here
It's quite tricky, but I think the right thing to do for (yada nil)
is ALWAYS return 404. That's what most people (including me) would expect. It's also useful as a way of terminating a bidi routing tree as a 'catch-all' - [true (yada nil)]
feels short and easy to remember
So for this reason I'm thinking to say that a resource must either have :methods
or :response
(which would be a function)
This also has another benefit of bringing back the (yada (fn [ctx] ...))
case
there are some cases where you just want to take an existing Ring handler and adapt it to yada
making a POST request to an unknown resource with handler (yada nil)
responds with a status 404 for me. That’s using [yada "1.1.0-20160202.093502-16”]
What is the origin of the yada name @malcolmsparks?
it's a hat-tip to zach and aleph, it means 'to know' - the opposite of a Ring handler function that is 'only callable'
a yada resource-model gives you information up-front
to be fair, we tend to use 4-letter words in juxt because they're short and quick to type (we're busy people!)
juxt yada bidi aero, those are the ones I can name off the top of my head. Didn't expect it would have a meaning like that.
@dominicm: good summary