ring-swagger

ring-swagger & compojure-api
petr.mensik 2017-11-22T14:18:27.000364Z

@ikitommi thank you, that worked

petr.mensik 2017-11-22T14:19:36.000600Z

May I have next question? I am trying to apply wrap-reload and other middleware to all routes but it doesn't seems to work, so is this a correct way in Compojure 2.0?

(defapi app
  api-config
  (route-middleware [[wrap-resource resources-root] wrap-reload
                     [wrap-cors :access-control-allow-origin [#"\\*"] :access-control-allow-methods [:get :post :put :delete :patch]]])
  (context "/auth" []
    api-routes-login) ; unprotected routes

  (context "/api" []
    :header-params [authorization :- String]
    :middleware [[wrap-authentication config/backend]
                 [wrap-authorization config/backend]]
    api-routes-users ; protected routes
    api-routes-overview360)
  (undocumented app-routes
                not-found-routes))