Making stubs permanent on wiremock

Viewed 933

I am new to wiremock and would like to create permanent custom stubs. I was able to create stubs by running a standalone wiremock instance and sending post requests using curl commands to make the stubs. That works fine, but as soon as I restart the wiremock instance, all the stubs get lost. I was wondering if there was a way to make those stubs permanent, even after restarting the wiremock server.

When running wiremock for the first time, I tried doing record-mappings to permanently save the stubs, but that did not seem to work.

Thank you in advance!

1 Answers

When you add the stubs via curl (or the HTTP API generally), if you add a "persistent": true attribute to the stub JSON at the top level, WireMock will save it to disk.

Related