Skip to content

Commit

Permalink
cer#44. Removed DOCKER_HOST_IP from example urls. Added swagger ui in…
Browse files Browse the repository at this point in the history
…fo to readme.
  • Loading branch information
dartartem committed Oct 30, 2020
1 parent e0d0ccb commit 123a1c1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,9 @@ Next, launch the services using [Docker Compose](https://docs.docker.com/compose
```

Finally, you can open the home page, which is served up by the API Gateway: `http://localhost:8080`

# Using the Swagger UI

The individual services are Swagger "enabled".

Open the url `http://localhost:<SERVICE-PORT>/swagger-ui/index.html`
12 changes: 6 additions & 6 deletions java-spring/handy-curl-commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,30 @@ customer=$(curl -v --data '{
},
"phoneNumber": "415551212",
"ssn": "123-45-6789"
}' -H "content-type: application/json" http://${DOCKER_HOST_IP?}:8083/customers)
}' -H "content-type: application/json" http://localhost:8083/customers)

customerId=$(echo $customer | jq -r .id)

echo customerId=$customerId

# Create account 1

account1=$(curl -v --data "{\"initialBalance\" : 500, \"customerId\" : \"$customerId\"}" -H "content-type: application/json" http://${DOCKER_HOST_IP?}:8080/accounts)
account1=$(curl -v --data "{\"initialBalance\" : 500, \"customerId\" : \"$customerId\"}" -H "content-type: application/json" http://localhost:8080/accounts)

accountId1=$(echo $account1 | jq -r ".accountId")

curl -v http://${DOCKER_HOST_IP?}:8081/accounts/$accountId1
curl -v http://localhost:8081/accounts/$accountId1

echo accountId1=$accountId1

# Create account 2

account2=$(curl -v --data "{\"initialBalance\" : 300, \"customerId\" : \"$customerId\"}" -H "content-type: application/json" http://${DOCKER_HOST_IP?}:8080/accounts)
account2=$(curl -v --data "{\"initialBalance\" : 300, \"customerId\" : \"$customerId\"}" -H "content-type: application/json" http://localhost:8080/accounts)

accountId2=$(echo $account2 | jq -r ".accountId")


curl -v http://${DOCKER_HOST_IP?}:8081/accounts/$accountId2
curl -v http://localhost:8081/accounts/$accountId2

echo accountId2=$accountId2

Expand All @@ -48,7 +48,7 @@ echo accountId2=$accountId2

transfer=$(curl -v --data "{\"amount\" : 150,
\"fromAccountId\" : \"$accountId1\", \"toAccountId\" : \"$accountId2\"
}" -H "content-type: application/json" http://${DOCKER_HOST_IP?}:8082/transfers)
}" -H "content-type: application/json" http://localhost:8082/transfers)

echo transfer=$transfer

Expand Down

0 comments on commit 123a1c1

Please sign in to comment.