Fixes #19. Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
5122000d48
commit
b62a807f89
3 changed files with 18 additions and 3 deletions
|
@ -13,9 +13,10 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
|
||||
"git.riou.xyz/jriou/coller/internal"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
|
||||
"git.riou.xyz/jriou/coller/internal"
|
||||
)
|
||||
|
||||
var passwordLength = internal.MIN_PASSWORD_LENGTH
|
||||
|
@ -472,6 +473,12 @@ func (s *Server) Start() error {
|
|||
r.Path("/").Handler(&HomeHandler{Templates: templates, PageData: p}).Methods("GET")
|
||||
|
||||
addr := fmt.Sprintf("%s:%d", s.config.ListenAddress, s.config.ListenPort)
|
||||
s.logger.Info(fmt.Sprintf("listening to %s:%d", s.config.ListenAddress, s.config.ListenPort))
|
||||
return http.ListenAndServe(addr, r)
|
||||
|
||||
if s.config.HasTLS() {
|
||||
s.logger.Info(fmt.Sprintf("listening to %s:%d (https)", s.config.ListenAddress, s.config.ListenPort))
|
||||
return http.ListenAndServeTLS(addr, s.config.TLSCertFile, s.config.TLSKeyFile, r)
|
||||
} else {
|
||||
s.logger.Info(fmt.Sprintf("listening to %s:%d (http)", s.config.ListenAddress, s.config.ListenPort))
|
||||
return http.ListenAndServe(addr, r)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue