Merge branch '9-issue' into 'main'

Resolve "add health path in lib"

Closes #9

See merge request h6n/users!11
This commit is contained in:
Nicolas Boufidjeline 2024-04-01 17:53:34 +00:00
commit 51de27f294
2 changed files with 12 additions and 5 deletions

View file

@ -40,10 +40,6 @@ func isLoggedIn(c echo.Context) error {
return c.NoContent(http.StatusNoContent)
}
func status(c echo.Context) error {
return c.NoContent(http.StatusOK)
}
func init_database() {
var err error
@ -104,7 +100,7 @@ func main() {
e.GET("/", isLoggedIn)
e.POST("/", login)
e.DELETE("/", logout)
e.GET("/health", status)
e.GET("/health", health.Health)
e.GET("/swagger/*", echoSwagger.WrapHandler)
// Start server

11
lib/health/status.go Normal file
View file

@ -0,0 +1,11 @@
package health
import (
"net/http"
"github.com/labstack/echo/v4"
)
func Health(c echo.Context) error {
return c.NoContent(http.StatusOK)
}