v1.2.0: back: use health skip from lib
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
41563e9256
commit
0ad1626bdb
1 changed files with 3 additions and 8 deletions
11
cmd/main.go
11
cmd/main.go
|
|
@ -9,6 +9,7 @@ import (
|
||||||
echoSwagger "github.com/swaggo/echo-swagger"
|
echoSwagger "github.com/swaggo/echo-swagger"
|
||||||
logins "gitlab.g3e.fr/h6n/users/internal"
|
logins "gitlab.g3e.fr/h6n/users/internal"
|
||||||
"gitlab.g3e.fr/h6n/users/lib"
|
"gitlab.g3e.fr/h6n/users/lib"
|
||||||
|
"gitlab.g3e.fr/h6n/users/lib/health"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
_ "github.com/lib/pq"
|
_ "github.com/lib/pq"
|
||||||
|
|
@ -58,20 +59,14 @@ func skip_auth(c echo.Context) bool {
|
||||||
if c.Request().Method == "POST" && c.Path() == "/" {
|
if c.Request().Method == "POST" && c.Path() == "/" {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if c.Request().Method == "GET" && c.Path() == "/health" {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if len(c.Path()) > 9 && c.Path()[:9] == "/swagger/" {
|
if len(c.Path()) > 9 && c.Path()[:9] == "/swagger/" {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return health.IsHealth(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
func skip_log(c echo.Context) bool {
|
func skip_log(c echo.Context) bool {
|
||||||
if c.Request().Method == "GET" && c.Path() == "/health" {
|
return health.IsHealth(c)
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @title Users
|
// @title Users
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue