johanhaleby / stub-http

Client library agnostic way to stub HTTP endpoints in Clojure
MIT License
70 stars 10 forks source link

Allow passing in an already started server to with-routes! macro? #2

Open johanhaleby opened 8 years ago

johanhaleby commented 8 years ago

If so it would be possible to use bindings which can be nice. The server should not be stopped afterwards but the route-state should be reset.

(with-routes! *server*
  [times (atom 0)]
  {"/something" (fn [_] (if (< @times 2)
                            <resp 1>
                            <resp 2>))})