Ajouter *http.Client dans handlers avec bottinApiClient #32

Merged
vlbeaudoin merged 1 commit from fix/bottin-http-client into main 2023-12-28 13:31:33 -05:00
2 changed files with 8 additions and 0 deletions
Showing only changes of commit d60cf01c82 - Show all commits

View file

@ -19,7 +19,11 @@ func GetHealth(c echo.Context) error {
bottinApiProtocol := viper.GetString("bottin.api.protocol")
bottinApiPort := viper.GetInt("bottin.api.port")
bottinClient := http.DefaultClient
defer bottinClient.CloseIdleConnections()
bottinConnection := bottindata.NewApiClient(
bottinClient,
bottinApiKey,
bottinApiHost,
bottinApiProtocol,

View file

@ -80,8 +80,12 @@ func PostTransactions(c echo.Context) error {
bottinApiProtocol := viper.GetString("bottin.api.protocol")
bottinApiPort := viper.GetInt("bottin.api.port")
bottinClient := http.DefaultClient
defer bottinClient.CloseIdleConnections()
// Using bottin's API client
bottinApiClient := bottindata.NewApiClient(
bottinClient,
bottinApiKey,
bottinApiHost,
bottinApiProtocol,