From f8e7677c9ede49666a08d0196c6963dc88cc6009 Mon Sep 17 00:00:00 2001 From: Teemu Patja Date: Sat, 4 Mar 2017 13:01:32 +0200 Subject: [PATCH] Make swagger-ui available only for dev profile --- src/clj/commiteth/routes/services.clj | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/clj/commiteth/routes/services.clj b/src/clj/commiteth/routes/services.clj index d8bf155..2da22e4 100644 --- a/src/clj/commiteth/routes/services.clj +++ b/src/clj/commiteth/routes/services.clj @@ -13,6 +13,7 @@ [commiteth.github.core :as github] [clojure.tools.logging :as log] [commiteth.eth.core :as eth] + [commiteth.config :refer [env]] [crypto.random :as random] [clojure.set :refer [rename-keys]] [clojure.string :as str])) @@ -141,11 +142,12 @@ (defapi service-routes - {:swagger {:ui "/swagger-ui" - :spec "/swagger.json" - :data {:info {:version "0.1" - :title "commitETH API" - :description "commitETH API"}}}} + (when (:dev env) + {:swagger {:ui "/swagger-ui" + :spec "/swagger.json" + :data {:info {:version "0.1" + :title "commitETH API" + :description "commitETH API"}}}}) (context "/api" [] (GET "/top-hunters" []