SSWMUI (Super Simple WireMock User Interface) is an ASP.NET Razor Page making use of WireMock.NET, providing the possibility to create, start, stop and configure web api proxy instances. You can edit and delete your mappings via a simple Webpage. SSWMUI stores everything in a local database, with that, your service settings and mappings persist. You can even exchange the database to cover different scenarios, if you like. In its current state it is super limited in its functionality but will grow continuously.
First you must download the latest release
directly form GitHub or download the image from the Docker Hub
(docker pull vanubor42/sswmui:[version]-[arm64|amd64]
ex: docker pull vanubor42/sswmui:v0.1.0-arm64
)
Just start the application, either your locally downloaded Wiremock.exe (on windows) / Wiremock (sh script on linux) or run the docker image on any OS docker run --name mySSWMUI -e ASPNETCORE_HTTP_PORTS=5000 -p 5000:5000 -p 8081:8081 vanubor42/sswmui
and browse to the start page (by default http://localhost:5000). If you create new services that listen on additional ports, dont forget to bind your new ports on the docker container as well.
On the start page you can see a list of services. Each service can mock the api calls to a configured web api endpoint.
Each row shows a service that is bound to a dedicated port.
Besides a unique id, a name and the status of the service (running / stopped),
you can:
- start the service
- stop the service
- delete the service
- edit the configuration of the service
- display the configuration of the service
- see all mappings of the service (mappings are explained down below)
Basically, what WireMock does is providing a "man in the middle" for Web API calls, recording them. After it has recorded a call to an endpoint, it will not forward it again (on a second call), but answer "on its own". Those recordings are called mappings. You can see a list of all mappings via the mappings button on each service row. Now you can adjust the mappings to your needs and with that mock and external or your own Web API with ease.
There are basically two different ways to configure a service.
As SSWMUI is basically just a super simple wrapper (providing a Web UI) around WireMock.NET, you can just use the Admin API of WireMock.NET. (by default each service starts with the Admin API enabled - you can disable it)
Each service has a very limited configuration page, you can access via the "Settings" button on each service row. The settings should be self-explanatory, if not, please see WireMock.NET, as the settings are just 1:1 to the original.
The Mapping page shows all active mappings on a service. You can configure the mappings via a json file in your browser. To see details on how mappings work, see the WireMock.NET WIKI