add http config loader

This commit is contained in:
yanghao05
2023-04-27 16:27:09 +08:00
parent da7cde1149
commit f1fc4cf7fa
3 changed files with 65 additions and 13 deletions

View File

@@ -26,8 +26,8 @@ func (e *Service) GetEngine() interface{} {
}
func (e *Service) Serve() error {
if e.conf.Https {
return e.Engine.RunTLS(e.conf.PortString(), e.conf.HttpsCert, e.conf.HttpKey)
if e.conf.Tls != nil {
return e.Engine.RunTLS(e.conf.PortString(), e.conf.Tls.Cert, e.conf.Tls.Key)
}
return e.Engine.Run(e.conf.PortString())
}