This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-10
Channels
- # aleph (1)
- # aws-lambda (1)
- # beginners (80)
- # boot (20)
- # cider (75)
- # cljs-dev (45)
- # cljsjs (1)
- # cljsrn (11)
- # clojure (428)
- # clojure-dusseldorf (13)
- # clojure-italy (4)
- # clojure-russia (153)
- # clojure-spec (47)
- # clojure-taiwan (1)
- # clojure-uk (62)
- # clojurescript (84)
- # cursive (19)
- # datascript (96)
- # datomic (75)
- # dirac (9)
- # docs (3)
- # emacs (19)
- # jobs (5)
- # jobs-discuss (20)
- # jobs-rus (17)
- # lein-figwheel (5)
- # leiningen (1)
- # liberator (4)
- # luminus (12)
- # off-topic (4)
- # om (31)
- # onyx (102)
- # pamela (1)
- # parinfer (3)
- # pedestal (3)
- # proton (1)
- # protorepl (14)
- # re-frame (54)
- # reagent (22)
- # rum (40)
- # spacemacs (2)
- # specter (8)
- # test-check (5)
- # unrepl (110)
- # untangled (80)
- # vim (3)
- # yada (46)
response-for
request-for also a thing
yet another thing I must give Pedestal credit for coming up with. Copying is a form of flattery ;)
how can I coerce bidi tree to yada handler explicitly? I try yada.handler/as-handler
(this is what I found in aleph/listener
), but the response for any request is some nested html table with :body, :headers and :status 501
Had this issue the other day also ๐ Haven't been able to contribute it back though
@dominicm what I'm trying to do is wrap top level yada handler (bidi tree actually) in a middleware, so I thought I'll first make it a yada handler (which implements IFn afaik and can be called by middleware)
would it make sense to add this to yada, or maybe there are some edge cases which prevent it from being added there?
other thing, does yada support specifying media-type "qualities" server-side with qs=0.9
param?
for ex when client sends Accept: */*
and I prefer to send text/html
over application/json
Apache (http://httpd.apache.org/docs/current/content-negotiation.html) and other web servers support that for content negotiation
when I was a kid I thought deleting code < writing code, but now I concur with the above
anyway, checked setting qualities for declared media-types in :produces
, works great (with q=
, not qs=
)
I have old clients running out there which are sending Accept: */*
but always expecting html response, this will greatly help when adding more representations to this resource โค๏ธ
Has anyone managed to set non-clojure.core global vars via the :global-vars
key in the project.clj?
Iโm trying to set a value for yada.body/*output-errors*
but getting a ClassNotFound exception
Or is there a better way to set the value of that var?
@achesnais thanks for mentioning yada.body/*output-errors*
, I was looking for a way to hide errors/stack traces and ended up with overrided whole range of 4xx/5xx status responses
Iโd love for it not to be a global var, but rather an option passed in to the yada/listener constructor. That way you the printing of stacktraces is decided by your config
yada looks really cool
As an fyi, I think only yada.yada is the public api, everything else is "implementation detail" subject to change
Declaratively coding your resources has always been a good idea with terrible implementations in other languages (especially when that involves another xml dsl)โฆ but this looks great
It's an interesting concept, I wonder if people will grasp the extension points. For example, I wanted to have a simpler Access Control system that was app-wide, so I used a custom attribute :myapp/permissions
which described in my domain the possible restrictions:
{:post :public :get :logged-in}
Very simple in yada