diff --git a/README.md b/README.md index 0ef2066a44691106dbdd5ea2c7de61188d67306c..4f2cb80861d6beeada42adf9702535b863389479 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,36 @@ ## Getting Started -Start without Docker: - - # cd src/myaktion && go run main.go +### Start without Docker: +``` +./scripts/start-mariadb.sh +# cd src/gomazon && go run main.go -## Build, Start and Stop service using Docker Compose +``` - # docker compose build - # docker compose up - # docker compose down +### Build, Start and Stop service using Docker Compose +``` +docker compose build +docker compose up +docker compose down +``` -ADD Product +## All API Functions +In this section all API-Functions will be presented with an example call! + +### GET JWT-Token +Use the Result-Token for all marked API-Functions! +``` +curl --location --request GET 'localhost:8080/createJWT' \ +--header 'Content-Type: application/json' \ +--data '{ + "username": "user", + "isAdmin": true +}' +``` +### CREATE PRODUCT (Admin only) ``` curl -H "Content-Type: application/json" -d '{"description":"test","totalrating":4.0,"price":2.38}' localhost:8080/product/new ```