A Clojure library that wraps wiremock by @superaking
(require '[clj-wiremock.core :refer :all])
; create a new server on the default port 8080
(def wiremock-server (server))
; or to use a custom port pass a config to the server
(def wiremock-server (server (config { :port 11111 })))
; start the server - load http://localhost:8080/__admin/ in a browser to see it running
(start wiremock-server)
; set up a stub then refresh the __admin page to see your new mapping
(stub { :request { :method "GET" :url "/hello"}
:response { :status 200 :body "Hello World"}})
; load http://localhost:8080/hello in a browser
; reset the mappings - handy when you want to clear state between tests
(reset-mappings wiremock-server)
; stop the server
(stop wiremock-server)
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |