This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-03
Channels
- # beginners (20)
- # boot (407)
- # cider (17)
- # cljs-dev (29)
- # cljsrn (33)
- # clojure (169)
- # clojure-greece (17)
- # clojure-russia (47)
- # clojure-spec (40)
- # clojure-uk (81)
- # clojurescript (64)
- # clr (3)
- # copenhagen-clojurians (3)
- # core-async (1)
- # cursive (28)
- # datomic (26)
- # editors-rus (4)
- # emacs (10)
- # events (1)
- # figwheel (1)
- # funcool (1)
- # hoplon (82)
- # jobs (1)
- # klipse (10)
- # lein-figwheel (26)
- # leiningen (1)
- # off-topic (2)
- # om (153)
- # overtone (2)
- # pedestal (15)
- # proton (1)
- # re-frame (6)
- # ring-swagger (1)
- # rum (1)
- # slack-help (4)
- # untangled (56)
- # vim (24)
- # yada (2)
I'm pretty new to building web stuff, so please forgive the possibly silly question. What do you mean by "clojure endpoints"?
Ah, that makes more sense. But no, haven't looked at any of the google stuff I'm afraid.
yeah, it's pretty much like swagger, it helps us generating a json which is a description of the service, then we can generate client api ( ios, android , web ) based on it. And I find it's faster to use google cloud endpoints than using swagger ( in terms of hosting services ourselves )
Oh, that is cool. I tried using swagger-api with pedestal, but found that it seemed to get in the way more than it helped.
Plus I'm not exposing anything for direct access by anyone else, so there wasn't much advantage except for some pretty docs.
Hi @grant, late response b/c I was traveling. When you say :origin nil
are you talking about a header?
Hi Michael. Yes, that is what I was talking about. And I actually figured out what I was trying to do. Just adding the route worked. Though I am still curious if it is possible to do per route origin checking.
I don't think there's a direct way to do it in the current routers. There are a couple of ways to solve the problem. They just take a bit more work.
1. You could create an "origin router". It would sit in front of two or more regular routers. Instead of looking at the path in the request, it would look at the origin then enqueue one of the other routers. This would work best if you've got several routes that should be treated differently based on origin.
2. You could create an origin interceptor. Your router would direct all requests for /api/health-check
to the same interceptor vector, but if the origin doesn't match, then the origin interceptor can terminate the request. That would return a 404 exactly as if the route didn't exist.