Implémenter route /v0/health

Ajouter error type si dbclient ou bottinclient ne sont pas implémentés

Ajouter echo.Group v0
This commit is contained in:
Victor Lacasse-Beaudoin 2023-09-15 18:13:48 -04:00
parent 3791631045
commit dc72748fbe
4 changed files with 76 additions and 0 deletions

View file

@ -7,6 +7,7 @@ import (
"fmt"
"log"
"git.agecem.com/agecem/bottin-ag/apihandler"
"git.agecem.com/agecem/bottin-ag/config"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
@ -27,6 +28,12 @@ var apiCmd = &cobra.Command{
e.Pre(middleware.AddTrailingSlash())
v0 := e.Group("/v0")
handler := apihandler.New()
apihandler.DeclareRoutes(v0, handler)
e.Start(fmt.Sprintf(":%d", cfg.API.Port))
},
}