[BREAKING] Déplacer route /v4 vers /v4/health #12

Merged
vlbeaudoin merged 6 commits from breaking/v4-to-health into main 2023-06-02 03:20:13 -04:00
Showing only changes of commit 6d010c5009 - Show all commits

View file

@ -6,7 +6,6 @@ import (
"git.agecem.com/agecem/bottin/v4/data" "git.agecem.com/agecem/bottin/v4/data"
"github.com/labstack/echo/v4" "github.com/labstack/echo/v4"
"github.com/spf13/viper"
) )
func GetIndex(c echo.Context) error { func GetIndex(c echo.Context) error {
@ -14,30 +13,10 @@ func GetIndex(c echo.Context) error {
} }
func GetMembre(c echo.Context) error { func GetMembre(c echo.Context) error {
apiClientKey := viper.GetString("web.api.key") apiClient := data.NewApiClientFromViper()
apiClientHost := viper.GetString("web.api.host")
apiClientProtocol := viper.GetString("web.api.protocol")
apiClientPort := viper.GetInt("web.api.port")
/*
log.Printf(`
apiClientKey: %s
apiClientHost: %s
apiClientProtocol: %s
apiClientPort: %d`,
apiClientKey, apiClientHost, apiClientProtocol, apiClientPort,
)
*/
apiClient := data.NewApiClient(apiClientKey, apiClientHost, apiClientProtocol, apiClientPort)
membreID := c.QueryParam("membre_id") membreID := c.QueryParam("membre_id")
/*
// TODO
log.Printf("Requesting membreID: [%s]", membreID)
*/
membre, err := apiClient.GetMembre(membreID) membre, err := apiClient.GetMembre(membreID)
if err != nil { if err != nil {
return c.Render(http.StatusBadRequest, "index-html", struct { return c.Render(http.StatusBadRequest, "index-html", struct {