Log errors

This commit is contained in:
Jannis Mattheis 2018-02-19 17:20:15 +01:00 committed by Jannis Mattheis
parent 80887bf4b5
commit a413b3d182
1 changed files with 4 additions and 2 deletions

View File

@ -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 {