Permettre d'exposer le serveur API par https #54
1 changed files with 9 additions and 1 deletions
|
@ -22,7 +22,15 @@ func TestAPI(t *testing.T) {
|
|||
httpClient := http.DefaultClient
|
||||
defer httpClient.CloseIdleConnections()
|
||||
|
||||
vokiClient := voki.New(httpClient, "localhost", cfg.API.Key, cfg.API.Port, "http")
|
||||
var protocol string
|
||||
switch cfg.API.TLS.Enabled {
|
||||
case true:
|
||||
protocol = "https"
|
||||
case false:
|
||||
protocol = "http"
|
||||
}
|
||||
|
||||
vokiClient := voki.New(httpClient, "localhost", cfg.API.Key, cfg.API.Port, protocol)
|
||||
apiClient := APIClient{vokiClient}
|
||||
|
||||
t.Run("get API health", func(t *testing.T) {
|
||||
|
|
Loading…
Reference in a new issue