Skip to content

Commit

Permalink
feat: Add health check info on readme (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
allisson committed Mar 8, 2021
1 parent b81209a commit 8f1338a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
@@ -1,4 +1,4 @@
name: Release
name: release

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
@@ -1,4 +1,4 @@
name: Verify
name: verify

on:
push:
Expand Down
19 changes: 19 additions & 0 deletions README.md
Expand Up @@ -231,8 +231,27 @@ curl --location --request GET 'http://localhost:8000/v1/delivery-attempts/d72719
}
```

### Health check

The health check server is running on port defined by envvar POSTMAND_HEALTH_CHECK_HTTP_PORT (defaults to 8001).

```bash
curl --location --request GET 'http://localhost:8001/healthz'
```

```javascript
{
"success":true
}
```

### Environment variables

All environment variables is defined on file local.env.

## How to build docker image

```
docker build -f Dockerfile -t postmand .
```

14 changes: 7 additions & 7 deletions local.env
@@ -1,7 +1,7 @@
POSTMAND_DATABASE_URL='postgres://user:pass@localhost:5432/postmand?sslmode=disable'
# See https://github.com/golang-migrate/migrate/tree/master/source/file
POSTMAND_DATABASE_MIGRATION_DIR='file://db/migrations'
POSTMAND_DATABASE_MAX_OPEN_CONNS='2'
POSTMAND_POLLING_INTERVAL='1000'
POSTMAND_HTTP_PORT='8000'
POSTMAND_HEALTH_CHECK_HTTP_PORT='8001'
POSTMAND_DATABASE_URL='postgres://user:pass@localhost:5432/postmand?sslmode=disable' # main database
POSTMAND_TEST_DATABASE_URL='postgres://user:pass@localhost:5432/postmand_test?sslmode=disable' # test database
POSTMAND_DATABASE_MIGRATION_DIR='file://db/migrations' # See https://github.com/golang-migrate/migrate/tree/master/source/file
POSTMAND_DATABASE_MAX_OPEN_CONNS='2' # sets the maximum number of open connections to the database
POSTMAND_POLLING_INTERVAL='1000' # worker database polling interval (in miliseconds)
POSTMAND_HTTP_PORT='8000' # port for the api server
POSTMAND_HEALTH_CHECK_HTTP_PORT='8001' # port for health check server

0 comments on commit 8f1338a

Please sign in to comment.