open flag

This commit is contained in:
Nazar Kanaev
2021-01-18 23:16:13 +00:00
parent e79cb9e6e0
commit 20a0a6724a
3 changed files with 16 additions and 5 deletions

View File

@@ -37,6 +37,14 @@ func New(db *storage.Storage, logger *log.Logger, addr string) *Handler {
}
}
func (h *Handler) GetAddr() string {
proto := "http"
if (h.CertFile != "" && h.KeyFile != "") {
proto = "https"
}
return proto + "://" + h.Addr
}
func (h *Handler) Start() {
h.startJobs()
s := &http.Server{Addr: h.Addr, Handler: h}