This message was deleted.
# help
s
This message was deleted.
t
Hi @TheUsharik if you’d like to use WireMock Java to upload a folder to WireMock Cloud, you need to do something like:
Copy code
WireMock wm = WireMock.create()
                    .scheme("https")
                    .host("my-mock-api.wiremockapi.cloud")
                    .port(443)
                    .authenticator(new ClientTokenAuthenticator("<API token>"))
                    .build();

wm.loadMappingsFrom("/path/to/folder"); // Should be the parent folder of "mappings"
t
Thank you, but we are using Wiremock as a docker container and we need to change the path to the mapping folder on the run. Is that possible with admin REST API?
o
WireMock Docker image loads the configuration files on startup. While you can definitely use the admin API to add more mappings, for me it seems to be going against the best practices. Normally it is advised to use a static image where all the configurations are bundled Why wouldn't you need to add it on the flight?
t
Because we have several scenaries and we need to switch between them.
t
In this case I suggest pulling the single, all-stubs JSON from the API e.g.
GET http://<docker host>:<docker port>/__admin/mappings
then posting this to the WireMock Cloud import API endpoint, which is
/__admin/mocklab/imports