modified: main_dc/docker-compose.yml
modified: main_dc/yalarba/api_yal/internal/router/router.go add depends on db to api_yal service add auth path for check healt
This commit is contained in:
@@ -282,6 +282,9 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
APP_PORT: 8787
|
APP_PORT: 8787
|
||||||
LOG_LEVEL: info
|
LOG_LEVEL: info
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
env_file:
|
env_file:
|
||||||
- ./yalarba/api_yal/.env
|
- ./yalarba/api_yal/.env
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import (
|
|||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
func SetupRouter(db *gorm.DB, config *config.Config) http.Handler {
|
func SetupRouter(db *gorm.DB, config *config.Config) http.Handler {
|
||||||
|
|
||||||
zapLogger := logger.Get()
|
zapLogger := logger.Get()
|
||||||
@@ -23,5 +22,10 @@ func SetupRouter(db *gorm.DB, config *config.Config) http.Handler {
|
|||||||
json.NewEncoder(w).Encode(map[string]string{"status": "healthy"})
|
json.NewEncoder(w).Encode(map[string]string{"status": "healthy"})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
r.Get("/auth", func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
json.NewEncoder(w).Encode(map[string]string{"status": "ok"})
|
||||||
|
})
|
||||||
|
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user