This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-05
Channels
- # admin-announcements (4)
- # beginners (47)
- # boot (69)
- # cider (11)
- # cljsjs (1)
- # cljsrn (5)
- # clojure (163)
- # clojure-austin (17)
- # clojure-russia (27)
- # clojure-uk (46)
- # clojurescript (109)
- # core-async (28)
- # cursive (2)
- # data-science (1)
- # datavis (1)
- # datomic (9)
- # dirac (33)
- # funcool (8)
- # hoplon (1)
- # lein-figwheel (1)
- # leiningen (1)
- # luminus (23)
- # mount (3)
- # nyc (2)
- # off-topic (25)
- # om (3)
- # onyx (4)
- # perun (7)
- # re-frame (10)
- # reagent (2)
- # ring-swagger (4)
- # spacemacs (4)
- # uncomplicate (1)
- # untangled (21)
- # vim (2)
- # yada (2)
Hi folks, what’s the best idiom to make showing the browsable Swagger API configurable? I.e. if a var show-swagger-api is true, then http://my-app.com will show the nice, human-friendly API console AND serve all the REST endpoints of my app; but if my var show-swagger-api is false, then it WON’T show the API console — but it will still serve all the REST endpoints. Thanks in advance!
(I do not intend to mutate show-swagger-api except by setting environment variables prior to executing the Clojure program)
@eigenhombre: in c-api, api-options are just data and you can manipulate those freely. Something like: (api {:swagger {:ui (if show-swagger-api "/api-docs"), :spec "/swagger.json"}} ...)
thanks @ikitommi ! I forgot that the API changed to make that sort of thing trivial.