This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-13
Channels
- # beginners (14)
- # boot (108)
- # carry (6)
- # cider (28)
- # cljs-dev (107)
- # cljsrn (32)
- # clojars (4)
- # clojure (62)
- # clojure-austin (15)
- # clojure-berlin (1)
- # clojure-brasil (3)
- # clojure-chicago (1)
- # clojure-dev (9)
- # clojure-greece (2)
- # clojure-italy (4)
- # clojure-nl (1)
- # clojure-poland (2)
- # clojure-portugal (1)
- # clojure-russia (24)
- # clojure-spec (63)
- # clojure-uk (30)
- # clojurescript (123)
- # cursive (13)
- # data-science (1)
- # datascript (1)
- # datomic (27)
- # devcards (11)
- # dirac (1)
- # emacs (5)
- # events (4)
- # hoplon (27)
- # jobs (3)
- # juxt (3)
- # leiningen (11)
- # off-topic (18)
- # om (46)
- # om-next (7)
- # onyx (50)
- # pedestal (6)
- # portland-or (8)
- # proton (16)
- # re-frame (38)
- # reagent (21)
- # ring-swagger (14)
- # specter (46)
- # untangled (116)
- # vim (46)
- # yada (22)
Is it possible to call bidi/vhosts-model without knowing the host name?
Yes. Specify a wildcard, see bidi's README
If I try this:
(vhosts-model [:*
["/index.html" :index]
["login" :login]])
I get: ExceptionInfo Error in server model: [[(named (not (sequential? :*)) "Virtual host") nil nil]]
ExceptionInfo Error in server model: [[(named [(not (map? :*))] "Virtual host") nil nil]]
which I think might be the same error
I’ve been through a few iterations of randomly re-arranging square brackets, but it feels like a mug’s game.
All I can suggest is that you might be on an old version of bidi, or an old one is getting linked - can you try lein deps :tree
to make sure you've got bidi 2.0.12
@peterwestmacott sorry for your frustration, the wildcard feature is recent so there might be a bug but I've retested on my system and all seems ok
I hoping clojure.spec will make these errors a little less arduous
Once you're sure you're on the latest bidi, send me a bit more code with context and I'll try it here
definitely 2.0.12
I’ll try and come up with a minimal test case
okay, so I ran lein new test-bidi
to create a new project, modified the dependencies in the project.clj file to be:
:dependencies [[org.clojure/clojure "1.8.0"]
[bidi "2.0.12”]]
fired up a REPL in cursive and ran
(require '[bidi.vhosts :refer [vhosts-model]])
(vhosts-model
[:*
["/index.html" :index]
["/login" :login]])
and got: ExceptionInfo Error in server model: [[(named (not (sequential? :*)) "Virtual host") nil nil]] clojure.core/ex-info (core.clj:4617)
I should maybe add that I can inject the server name through an environment variable if I need to. So there is definitely a workaround here.