feature(api): permettre d'exposer le serveur API par https
Requiert `cfg.API.TLS.Enabled = true` et des fichiers valides pour `cfg.API.TLS.{CertificateFile,PrivateKeyFile}`
This commit is contained in:
parent
150782c42f
commit
4ce3d9f60b
1 changed files with 16 additions and 1 deletions
17
cmd.go
17
cmd.go
|
@ -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,
|
||||
),
|
||||
)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue