Skip to content

Commit

Permalink
Add GPL v3 text and enhance README with usage instructions and UI upd…
Browse files Browse the repository at this point in the history
…ates (#31)

* started to edit the README.md

* added GNU license

* Create LICENSE

* deleted wrong LICENSE

* Update README and Mappings detail enhancements

Expanded the README with detailed usage and configuration instructions. Added service name display in Mappings page for better context.

* Add line breaks and minor fixes in README.md

In this update, line breaks were added before some sections for better readability. Fixed minor grammatical errors and corrected the spelling of "SSMWUI" to "SSWMUI".

* Update README.md

* Fix typos and update README with Docker information

Corrected various typos and enhanced clarity in the README.md. Added instructions for obtaining SSMUI via GitHub releases or Docker, replacing the previous placeholder note about a Docker image.

* Correct typos and improve clarity in README.md

Fixed grammar and punctuation errors in the introduction for better readability. Corrected the name of "Docker Hub" and improved formatting in the 'How to use' section.
  • Loading branch information
vanUbor authored Aug 28, 2024
1 parent 525b106 commit de42d41
Show file tree
Hide file tree
Showing 7 changed files with 739 additions and 6 deletions.
Binary file added .assets/mappingsPageScreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .assets/startPageScreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

64 changes: 59 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,72 @@
_SSWMUI_ (Super Simple WireMock User Interface) is an ASP.NET Razor Page
making use of [WireMock.NET](https://github.com/WireMock-Net/WireMock.Net),
providing the possibility to create, start,
stop and configure web api proxy instances.
stop and configure web api proxy instances. You can edit and delete your mappings via a simple Webpage.
SSMWUI 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.

# How to use

coming soon
## Start

# Build
### Get SSMUI

First you must download the [latest](https://github.com/vanUbor/Wiremock/releases/latest) release
directly form GitHub or download the image from the [Docker Hub](https://hub.docker.com/) (Docker image coming soon)

### Run

Just start the application (either your locally downloaded Wiremock.exe or run the docker image)
and browse to the start page (by default <http://localhost:5000>).
On the start page you can see a list of services. Each service can mock the api calls to a configured web api endpoint.
![startPageScreen.png](.assets/startPageScreen.png)
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)

### Record and Mock

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.

## Configure

There are basically two different ways to configure a service.

### Admin API

As SSWMUI is basically just a super simple wrapper (providing a Web UI) around [WireMock.NET](https://github.com/WireMock-Net/WireMock.Net),
you can just use the [Admin API](https://github.com/WireMock-Net/WireMock.Net/wiki/Admin-API-Reference) of WireMock.NET.
(by default each service starts with the Admin API enabled - you can disable it)

### Configuration Page

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.

## Mappings

![startPageScreen.png](.assets/mappingsPageScreen.png)

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](https://github.com/WireMock-Net/WireMock.Net/wiki)

# Code

## Build

[![Build and Test](https://github.com/vanUbor/Wiremock/actions/workflows/Build.yml/badge.svg)](https://github.com/vanUbor/Wiremock/actions/workflows/Build.yml)

# Quality
## Quality

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=vanUbor_Wiremock&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=vanUbor_Wiremock)

Expand All @@ -41,4 +95,4 @@ coming soon

## Bugs & Issues

[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=vanUbor_Wiremock&metric=bugs)](https://sonarcloud.io/summary/new_code?id=vanUbor_Wiremock)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=vanUbor_Wiremock&metric=bugs)](https://sonarcloud.io/summary/new_code?id=vanUbor_Wiremock)
5 changes: 4 additions & 1 deletion WireMock/Pages/WireMockService/Mappings.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
ViewData["Title"] = "Mappings";
}
<div class="d-flex align-items-baseline">
<h2>Mappings</h2>
<h2>Mappings</h2>
&nbsp; of Service
&nbsp;"@Model.ServiceName"
&nbsp; (@Model.ServiceId)
</div>
<table class="table">
<thead>
Expand Down
2 changes: 2 additions & 0 deletions WireMock/Pages/WireMockService/Mappings.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class Mappings(
: PageModel
{
public int ServiceId { get; set; }
public string ServiceName { get; set; } = string.Empty;
public string? GuidSort { get; set; }
public string? TitleSort { get; set; }
public string? DateSort { get; set; }
Expand All @@ -31,6 +32,7 @@ public class Mappings(
public async Task<IActionResult> OnGet(int serviceId, string sortOrder, int? pageIndex)
{
ServiceId = serviceId;
ServiceName = (await Repository.GetModelAsync(serviceId)).Name;
GuidSort = string.IsNullOrEmpty(sortOrder) ? "guid_desc" : "";
TitleSort = sortOrder == "title" ? "title_desc" : "title";
DateSort = sortOrder == "date" ? "date_desc" : "date";
Expand Down
Binary file not shown.

0 comments on commit de42d41

Please sign in to comment.