Is there a way to specify `basePath` in wiremock? ...
# help
a
Is there a way to specify
basePath
in wiremock? Want to start my standalone wiremock server at http://localhost:8080/wiremock/ instead of http://localhost:8080
o
Unless I miss somethin g in https://github.com/wiremock/wiremock/blob/600c56531d43fb3d0138d3c9b85ff76be8870eb3[…]java/com/github/tomakehurst/wiremock/jetty/JettyHttpServer.java, it is not configurable at the moment when the default server is used. Am I right @Tom? While totally possible via extension, I think adding a CLI parameter would be justified here
t
There’s nothing OOTB to achieve this, but you could create a simple request filter extension to prepend
/wiremock
onto incoming URL paths.
s
can wiremock proxy to itself?
I’m thinking while it would not really be hosted at
/wiremock
- you could possibly make it appear to be with mappings
t
Yeah, you probably could do it that way actually, using the
proxyUrlPrefixToRemove
parameter to remove
/wiremock
. I’ve never tried it, but I can’t see any reason it wouldn’t work.
a
Thanks @Sam @Tom using proxy worked.
🙌 3