From 2122ebae6a61e45e6b3acfb1e3679fa2735a1c48 Mon Sep 17 00:00:00 2001 From: Paul Balogh Date: Sat, 20 Jan 2024 12:01:21 -0600 Subject: [PATCH] Provide highlights for readme Signed-off-by: Paul Balogh --- README.md | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 91ab013..8027ca2 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 ```