Skip to content

Commit

Permalink
Provide highlights for readme
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Balogh <[email protected]>
  • Loading branch information
javaducky committed Jan 20, 2024
1 parent fb9eced commit 2122eba
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ The default target for the `Makefile` will perform several tasks:
* vet code for errors using `go vet`
* compile binary for the current platform

:point_up: NOTE: To initially build the project, you may need to run the `make setup` command to install the tools utilized for builds.
> [!NOTE]
> To initially build the project, you may need to run the `make setup` command to install the tools utilized for builds.
Once built using `make`, you can **migrate** the database scripts and run the application:
```shell script
Expand All @@ -42,18 +43,21 @@ Once the image is available, you can simply run the provided script which will o
```shell script
./docker-run.sh
```
:point_up: NOTE: the `docker-run.sh` script is setup to **not** maintain state between executions.
This means each time you start the container, you will be starting with a freshly created database.
> [!IMPORTANT]
> The `docker-run.sh` script is setup to **not** maintain state between executions.
> This means each time you start the container, you will be starting with a freshly created database.
## Using the Application
Update the `DatabaseURI` setting in your `config.yaml` for the absolute path to the base project directory, i.e. the path for the directory containing this README.

:point_up: TIP: Use the very cool [HTTPie](https://httpie.org/) application for testing locally from the command-line.
> [!TIP]
> Use the very cool [HTTPie](https://httpie.org/) application for testing locally from the command-line.
Execute a `GET` command to retrieve the available _places_ from the database.
```shell script
$ http GET :9092/api/places

http GET :9092/api/places
```
```shell
HTTP/1.1 200 OK
Content-Length: 2
Content-Type: application/json
Expand All @@ -63,8 +67,9 @@ Date: Sat, 25 Jan 2020 05:33:57 GMT
```
Add a _place_ into the database using a `POST` command.
```shell script
$ http POST :9092/api/places name=NISC description="NISC Lake St. Louis Office" latitude:=38.7839 longitude:=90.7878

http POST :9092/api/places name=NISC description="NISC Lake St. Louis Office" latitude:=38.7839 longitude:=90.7878
```
```shell
HTTP/1.1 200 OK
Content-Length: 8
Content-Type: application/json
Expand All @@ -76,8 +81,9 @@ Date: Sat, 25 Jan 2020 05:34:08 GMT
```
Run the `GET` command again to retrieve _places_ which now include your newly added _place_!
```shell script
$ http GET :9092/api/places/1

http GET :9092/api/places/1
```
```shell
HTTP/1.1 200 OK
Content-Length: 217
Content-Type: application/json
Expand All @@ -98,8 +104,9 @@ Date: Sat, 25 Jan 2020 05:34:18 GMT
Use the `PATCH` command to update a specific value.
For example, we'll update the `Description` as follows:
```shell script
$ http PATCH :9092/api/places/1 description="Lake St. Louis"

http PATCH :9092/api/places/1 description="Lake St. Louis"
```
```shell
HTTP/1.1 200 OK
Content-Length: 203
Content-Type: application/json
Expand All @@ -118,8 +125,9 @@ Date: Sat, 25 Jan 2020 18:13:13 GMT
This returns the newly "patched" version of the _place_.
Next we'll remove the row using the `DELETE` method.
```shell script
$ http DELETE :9092/api/places/1

http DELETE :9092/api/places/1
```
```shell
HTTP/1.1 200 OK
Content-Length: 21
Content-Type: application/json
Expand All @@ -135,6 +143,6 @@ A core requirement for all _WeeSVC_ implementations is to implement the same API
To ensure compliance with the required API, [k6](https://k6.io/) is utilized within the [Workbench](https://github.com/weesvc/workbench) project.

To be a valid service, the following command MUST pass at 100%:
```
```shell script
k6 run -e PORT=9092 https://raw.githubusercontent.com/weesvc/workbench/main/scripts/api-compliance.js
```

0 comments on commit 2122eba

Please sign in to comment.