Liking cljdoc? Tell your friends :D

clj-wiremock

Build Status

A Clojure library that wraps wiremock by @superaking

Clojars Project

Hello World in the REPL

(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

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close