[REV]Update api http/https

This commit is contained in:
崔斌 2017-12-07 19:59:15 +08:00
parent fc69a1ac30
commit 73c6b3a32d

View File

@ -131,13 +131,16 @@ func (m *Manager) Run() {
logrus.Fatal(http.ListenAndServe(m.conf.WebsocketAddr, websocketRouter))
}
}()
go func() {
logrus.Infof("api listen on (HTTP) 0.0.0.0%v", m.conf.APIAddr)
logrus.Fatal(http.ListenAndServe(m.conf.APIAddr, m.r))
}()
if m.conf.APISSL {
logrus.Infof("api listen on (HTTPs) 0.0.0.0%v", m.conf.APIAddrSSL)
logrus.Fatal(http.ListenAndServeTLS(m.conf.APIAddrSSL, m.conf.APICertFile, m.conf.APIKeyFile, m.r))
go func() {
logrus.Infof("api listen on (HTTP) 0.0.0.0%v", m.conf.APIAddr)
logrus.Fatal(http.ListenAndServe(m.conf.APIAddr, m.r))
}()
} else {
logrus.Infof("api listen on (HTTP) 0.0.0.0%v", m.conf.APIAddr)
logrus.Fatal(http.ListenAndServe(m.conf.APIAddr, m.r))
}
}