diff --git a/.env.example b/.env.example index 7a081ab..074b38e 100644 --- a/.env.example +++ b/.env.example @@ -6,7 +6,7 @@ APP_ENV=local # Database Config DB_DIALECT=postgres DB_HOST=localhost -DB_PORT=26257 +DB_PORT=5432 DB_USERNAME=golang-api DB_PASSWORD=golang-api DB_NAME=golang-api diff --git a/controllers/api/v1/health_controller.go b/controllers/api/v1/health_controller.go index f7b200d..ab80918 100644 --- a/controllers/api/v1/health_controller.go +++ b/controllers/api/v1/health_controller.go @@ -1,6 +1,7 @@ package v1 import ( + "context" "net/http" "github.com/Improwised/golang-api/constants" @@ -79,7 +80,7 @@ func (hc *HealthController) Db(ctx *fiber.Ctx) error { ////////////////////// func healthDb(db *goqu.Database) error { - _, err := db.Query("SELECT 1") + _, err := db.ExecContext(context.TODO(), "SELECT 1") if err != nil { return err }