Permettre d'exposer le serveur API par https #54

Merged
vlbeaudoin merged 3 commits from vlbeaudoin/feature/tls-api into main 2024-09-03 14:29:12 -04:00 AGit
Showing only changes of commit 4ce3d9f60b - Show all commits

17
cmd.go
View file

@ -114,7 +114,22 @@ var apiCmd = &cobra.Command{
*/
// Execution
e.Logger.Fatal(e.Start(fmt.Sprintf(":%d", cfg.API.Port)))
switch cfg.API.TLS.Enabled {
case false:
e.Logger.Fatal(
e.Start(
fmt.Sprintf(":%d", cfg.API.Port),
),
)
case true:
e.Logger.Fatal(
e.StartTLS(
fmt.Sprintf(":%d", cfg.API.Port),
cfg.API.TLS.CertificateFile,
cfg.API.TLS.PrivateKeyFile,
),
)
}
},
}