Skip to content

Commit

Permalink
Merge pull request #15 from perebaj/improve_docs
Browse files Browse the repository at this point in the history
✨ chore: improve docs
  • Loading branch information
perebaj authored Sep 28, 2023
2 parents ed18b41 + 2c715b2 commit b46c169
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ dev:
dev/%:
@$(devrun) make ${*}

## API IP
.PHONY: ip
ip:
@docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' contractus_contractus_1

## Display help for all targets
.PHONY: help
help:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ Jamming around orders with API endpoints 🎸

## Environment Variables

To start the service locally, you need to export the current environment variables:
To start the service locally, you can type `make dev/start` and after that you can use the docker container IP to play around the routes, `make ip`

export CONTRACTUS_POSTGRES_URL=<>
Request example:

But, to play around the code and tests, it's possible with the command line ⤵️⤵️⤵️
curl http://(make ip):8080

## Command line
All commands are synthesized in the Makefile, to start the development environment, just run:
Expand Down Expand Up @@ -49,5 +49,5 @@ The testcase variable could be used to run a specific test

## Attention points
- For a while, the integration-tests just ran locally not in CI, this increased the time to ship code 🚀
- We already don't have a way to paginate transactions. 😔
- We don't have a way to paginate transactions. 😔
- To publish images and new releases, for now, the only way is using the command line, isn't automate by CI yet 😔
8 changes: 4 additions & 4 deletions api/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Request:

```bash
curl -i -X 'POST' \
'http://localhost:8080/upload' \
'http://<>:8080/upload' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F '[email protected];type=text/plain'
Expand All @@ -31,7 +31,7 @@ Request:

```bash
curl -X -i 'GET' \
'http://localhost:8080/balance/affiliate?name=<>' \
'http://<>:8080/balance/affiliate?name=<>' \
-H 'accept: application/json'
```

Expand Down Expand Up @@ -59,7 +59,7 @@ Request:

```bash
curl -X -i 'GET' \
'http://localhost:8080/balance/producer?name=<>' \
'http://<>:8080/balance/producer?name=<>' \
-H 'accept: application/json'
```

Expand All @@ -80,7 +80,7 @@ Request:

```bash
curl -i -X 'GET' \
'http://localhost:8080/transactions' \
'http://<>:8080/transactions' \
-H 'accept: application/json'
```

Expand Down
2 changes: 0 additions & 2 deletions api/docs/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ info:
description: API description
version: 0.0.0
servers:
- url: http://localhost:8080
description: Local server
- url: https://contractus-25fea2a1cfb3.herokuapp.com
description: Production server

Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ services:
volumes:
- db:/var/lib/postgresql/data
restart: unless-stopped
ports:
- 5432:5432
healthcheck:
test: pg_isready -U postgres
interval: 2s
Expand Down

0 comments on commit b46c169

Please sign in to comment.