This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-04
Channels
- # bangalore-clj (3)
- # beginners (23)
- # boot (89)
- # cider (11)
- # cljs-dev (22)
- # cljsjs (5)
- # cljsrn (21)
- # clojure (141)
- # clojure-android (1)
- # clojure-berlin (1)
- # clojure-greece (1)
- # clojure-italy (13)
- # clojure-mke (2)
- # clojure-nl (8)
- # clojure-norway (5)
- # clojure-russia (22)
- # clojure-sg (4)
- # clojure-spec (38)
- # clojure-uk (109)
- # clojurescript (150)
- # consulting (4)
- # core-async (7)
- # cursive (13)
- # datascript (8)
- # datomic (72)
- # dirac (185)
- # emacs (5)
- # figwheel (2)
- # flambo (1)
- # hoplon (13)
- # immutant (6)
- # lambdaisland (7)
- # lumo (46)
- # off-topic (13)
- # om (4)
- # onyx (1)
- # pedestal (1)
- # re-frame (68)
- # reagent (15)
- # rum (16)
- # slack-help (4)
- # spacemacs (22)
- # specter (3)
- # vim (10)
- # yada (28)
Sounds like your authorization isn't allowing POST requests?
Does anyone have any experience deploying yada on ec2 instances? I've been able to run the jar on my test server, but when I change the name to the configt file to use either the private hostname or ip, I don't get any of the usual messages when I run it nor can I connect to it in the browser. Unfortunately I don't have access to the box, so I'm having to ask the client to open ports or change security settings
Hi all. Is it possible to use the yada.yada/response-for with a resource? E.g. something like (yada.yada/response-for ["/foo" (yada.yada/resource {:methods {:get {:response (fn [ctx] "hello")}}})] :get "/foo")
?
The above results in {:status 406, :headers {"content-length" "18", "content-type" "text/plain;charset=utf-8"}, :body "\r\n\r\n{:status 406}\n"}
, which is not really what I wanted 🙂
Why is an exception on a GET request wrapped inside this? It seems irregular from the other methods. https://github.com/juxt/yada/blob/0a8cd0a1790db6885f835e847bba80796d4f7f79/src/yada/methods.clj#L194
@geek-draven yes, lots! I can help. You need to add a route-53 DNS entry and use that in the vhost section. See edge's config.edn
thanks @malcolmsparks, life was so much simpler when I only needed to worry about was processing flight data 🙂
Hey. I'm getting Context does not contain a :uri-info entry
when trying to use yada/path-for
.
The manual says "This feature is only available if your resources are declared in a bidi hierarchical route structure. Otherwise, the URL cannot be determined.", and I am using bidi for routing with yada here
@sickill are you using bidi's vhosts?
That's why
You can use bidi path-for directly
I read manual's section 5.1.1 and it didn't mention neither vhosts or using bidi directly
I also looked at https://github.com/juxt/yada/blob/master/examples/phonebook/src/phonebook/api.clj and https://github.com/juxt/yada/blob/master/examples/phonebook/src/phonebook/resources.clj , it uses yada/path-for
but I can't see any mention of vhosts
How can I test a resource including the default interceptor chains? response-for doesn’t seem to do this. Should I start a yada listener in my unit tests?
(defmacro with-server
“Runs resource in server and defines url for use in body”
[resource & body]
`(let [resource# ~resource
vmodel# (vhosts-model [:* [“/api/foo” resource#]])
listener# (y/listener vmodel#)
port# (:port listener#)
close# (:close listener#)
~‘url (str “:” port# “/api/foo”)]
[email protected]
(close#)))
I suspect you could call yada.handler/as-handler
on your routes or vmodel and get a ring handler back
and then you can just call it like (my-handler <ring request map>)