johanhaleby/stub-http

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

Opened this issue · 0 comments

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