Log errors
This commit is contained in:
parent
80887bf4b5
commit
a413b3d182
|
|
@ -6,6 +6,8 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"log"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gotify/server/config"
|
"github.com/gotify/server/config"
|
||||||
"golang.org/x/crypto/acme/autocert"
|
"golang.org/x/crypto/acme/autocert"
|
||||||
|
|
@ -35,9 +37,9 @@ func Run(engine *gin.Engine, conf *config.Configuration) {
|
||||||
httpHandler = certManager.HTTPHandler(httpHandler)
|
httpHandler = certManager.HTTPHandler(httpHandler)
|
||||||
s.TLSConfig = &tls.Config{GetCertificate: certManager.GetCertificate}
|
s.TLSConfig = &tls.Config{GetCertificate: certManager.GetCertificate}
|
||||||
}
|
}
|
||||||
go s.ListenAndServeTLS(conf.Server.SSL.CertFile, conf.Server.SSL.CertKey)
|
go log.Fatal(s.ListenAndServeTLS(conf.Server.SSL.CertFile, conf.Server.SSL.CertKey))
|
||||||
}
|
}
|
||||||
http.ListenAndServe(fmt.Sprintf(":%d", conf.Server.Port), httpHandler)
|
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", conf.Server.Port), httpHandler))
|
||||||
}
|
}
|
||||||
|
|
||||||
func redirectToHTTPS(port string) http.HandlerFunc {
|
func redirectToHTTPS(port string) http.HandlerFunc {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue