From e2e62e8625fb04008d6c435cecd023566e1f9d90 Mon Sep 17 00:00:00 2001 From: albrecht <flo@DESKTOP-ERC0T8S> Date: Mon, 10 Jul 2023 14:12:52 +0200 Subject: [PATCH] Added jwt in readme --- README.md | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0ef2066..4f2cb80 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 ``` -- GitLab