Liking cljdoc? Tell your friends :D

stub-http.core


NanoFakeServerclj

source

Responsecljprotocol

recorded-requestsclj

(recorded-requests this)

Return all recorded requests

Return all recorded requests

recorded-responsesclj

(recorded-responses this)

Return all recorded responses

Return all recorded responses
source

RouteModifiercljprotocol

add-route!clj

(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!clj

(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
source

start!clj

(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
       )
sourceraw docstring

with-routes!cljmacro

(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
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close