Merge pull request 'Ajouter *http.Client
à apiCmd
' (#33) from fix/cmd-api-http-client into main
Reviewed-on: #33
This commit is contained in:
commit
44e936cd33
1 changed files with 5 additions and 0 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"crypto/subtle"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"git.agecem.com/agecem/bottin-agenda/data"
|
||||
"git.agecem.com/agecem/bottin-agenda/handlers"
|
||||
|
@ -34,8 +35,12 @@ var apiCmd = &cobra.Command{
|
|||
bottinApiProtocol := viper.GetString("bottin.api.protocol")
|
||||
bottinApiPort := viper.GetInt("bottin.api.port")
|
||||
|
||||
bottinClient := http.DefaultClient
|
||||
defer bottinClient.CloseIdleConnections()
|
||||
|
||||
// Using bottin's API client
|
||||
bottinConnection := bottindata.NewApiClient(
|
||||
bottinClient,
|
||||
bottinApiKey,
|
||||
bottinApiHost,
|
||||
bottinApiProtocol,
|
||||
|
|
Reference in a new issue