(recorded-requests this)
Return all recorded requests
Return all recorded requests
(recorded-responses this)
Return all recorded responses
Return all recorded responses
(add-route! this request-spec response-spec)
Add a new route by supplied a request and response specification
Add a new route by supplied a request and response specification
(routes! this routes)
Overwrite existing routes with the supplied route map or route function
Overwrite existing routes with the supplied route map or route function
(start!)
(start! routes)
(start! settings routes)
Start a new fake web server on a random free port. Usage example:
(with-open [server (start! {"something" {:status 200 :content-type "application/json" :body (json/generate-string {:hello "world"})} {:path "/y" :query-params {:q "something")}} {:status 200 :content-type "application/json" :body (json/generate-string {:hello "brave new world"})}})] ; Do actual HTTP request )
Start a new fake web server on a random free port. Usage example: (with-open [server (start! {"something" {:status 200 :content-type "application/json" :body (json/generate-string {:hello "world"})} {:path "/y" :query-params {:q "something")}} {:status 200 :content-type "application/json" :body (json/generate-string {:hello "brave new world"})}})] ; Do actual HTTP request )
(with-routes! bindings? route-specs & body)
Applies route-specs and creates and stops a fake server implicitly
Applies route-specs and creates and stops a fake server implicitly
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close