This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-25
Channels
- # admin-announcements (3)
- # alda (2)
- # beginners (10)
- # boot (44)
- # cider (31)
- # cljs-dev (5)
- # cljsjs (2)
- # cljsrn (17)
- # clojure (181)
- # clojure-austin (2)
- # clojure-brasil (18)
- # clojure-canada (1)
- # clojure-conj (5)
- # clojure-dev (11)
- # clojure-gamedev (30)
- # clojure-russia (380)
- # clojure-spec (50)
- # clojure-uk (35)
- # clojurescript (146)
- # clojutre (1)
- # component (1)
- # cursive (62)
- # datomic (27)
- # dirac (7)
- # editors (23)
- # emacs (7)
- # events (34)
- # funcool (22)
- # hoplon (134)
- # jobs (22)
- # jobs-rus (7)
- # juxt (1)
- # kekkonen (1)
- # lein-figwheel (54)
- # leiningen (7)
- # luminus (2)
- # off-topic (5)
- # om (4)
- # onyx (27)
- # proton (5)
- # protorepl (2)
- # re-frame (16)
- # reagent (29)
- # rethinkdb (2)
- # schema (1)
- # untangled (61)
- # yada (9)
I'm a little confused about the role of vhosts. I added one to be able to test an api in which I'm using yada/uri-for
. It works... but when I try in a live application, I get the same error as before I added the vhosts for my tests.
Is yada/uri-for
the proper way to refer to other api endpoints?
Is there a way to serve a text/event-stream
in a yada resource that uses a custom data encoder besides EDN? I'm running into limitations with the EDN serializer and want to use transit with custom tags.
@frozenlock: It is, yep. Not sure why you'd see issues in prod. What's different about the environments?
dominicm : one is using vhosts... the live application doesn't 😛
@frozenlock: That'll be why uri-for doesn't exist then!
Hmm... but with vhosts (which I assume is for virtual hosts) I have to give a host, no?
Before trying to use :uri-for
I was manually fetching all the data in the request to reconstruct the entire URI.
(defn make-link
"Given a request context, return the full URL (with scheme and host)
for the current request, or for a given path."
([ctx] (make-link ctx (:uri (:request ctx))))
([ctx path]
(str (name (get-in ctx [:request :scheme]))
"://"
(or (get-in ctx [:request :headers "host"]) ;; for tests
(get-in ctx [:request :server-name]))
path)))