From 8f1338af63bf3834b899ea45f1bc85365bb7f599 Mon Sep 17 00:00:00 2001 From: Allisson Azevedo Date: Mon, 8 Mar 2021 18:21:11 -0300 Subject: [PATCH] feat: Add health check info on readme (#22) --- .github/workflows/release.yml | 2 +- .github/workflows/verify.yml | 2 +- README.md | 19 +++++++++++++++++++ local.env | 14 +++++++------- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cbcae0d..06fd306 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release +name: release on: push: diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 0e70c75..4413115 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -1,4 +1,4 @@ -name: Verify +name: verify on: push: diff --git a/README.md b/README.md index 39cd730..def63df 100644 --- a/README.md +++ b/README.md @@ -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 . ``` + diff --git a/local.env b/local.env index b32ca59..659a61b 100644 --- a/local.env +++ b/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