From 1d1005b7e88f90e174947b6a42f7adeb3a228192 Mon Sep 17 00:00:00 2001 From: David Lick Date: Mon, 21 Jun 2021 14:15:24 -0400 Subject: [PATCH] Update application README.md --- README.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2129ba9..355d470 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,42 @@ To start `supermarket-api` you will need to create an `.env` file at `cmd/api/.e ~$ cp cmd/api/example.env cmd/api/.env ``` -Supermarket-API has a Makefile with commonly ran commands. To use the Makefile append the command to `make` in your terminal: +### Usage + +Supermarket-API has a Makefile with commonly needed commands. To use the Makefile append the command to `make` in your terminal: ``` ~$ make run ``` + +### Testing + +To run unit tests for Supermarket-API use the included `make` command: + +``` +~$ make unit-test +``` + +To see test coverage: + +``` +~$ make test-coverage +``` + +To see a visual report of test coverage: +``` +~$ make coverage-report +``` + +### Docker + +A Dockerfile is included to allow running in ECS or GKS. Make commands are included for building and running the containers. `make docker-run` sets local development variables and should not be used for production. + +## API Spec +**Method**|**Endpoint**|**Description**|**Request Body**|**Response** +:-----:|:-----|:-----|:-----|:----- +GET|/v1/produce|Return all catalogued produce.| `null`| 200 OK
400 Bad Request
500 Internal Server Error +POST|/v1/produce|Add produce items to the catalogue.|`[{"code":"string","name":"string","price":{"amount":123,"currency":"USD"}}]`|201 Created
400 Bad Request
500 Internal Server Error +GET|/v1/produce/{produceCode}|Get the produce item with the given produceCode.|`null`|200 OK
400 Bad Request
500 Internal Server Error +DELETE|/v1/produce/{produceCode}|Delete the produce item with the given produceCode.|`null`|204 No Content
400 Bad Request
500 Internal Server Error + -- 2.54.0