Fork me on GitHub
#ring-swagger
<
2017-11-22
>
petr.mensik14:11:27

@ikitommi thank you, that worked

petr.mensik14:11:36

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))