~ritho/rweb

3276873bfb548fd30b8678e27a67ddf0adfbe45a — Ritho 2 months ago c201d7f
Start both the http and https servers at the same time.

Signed-off-by: Ritho <palvarez@ritho.net>
1 files changed, 6 insertions(+), 3 deletions(-)

M internal/server/server.go
M internal/server/server.go => internal/server/server.go +6 -3
@@ 20,6 20,7 @@ package server

import (
	"fmt"
	"log"

	"github.com/golang/glog"
	"github.com/labstack/echo/v4"


@@ 85,9 86,11 @@ func (s *server) Start() error {
	glog.Infof("Starting the server at %s:%d...", s.cfg.Server.Domain,
		s.cfg.Server.Port)
	if s.cfg.Server.TLS {
		if err := s.srv.Start(s.cfg.Server.Host); err != nil {
			return err
		}
		go func() {
			if err := s.srv.Start(s.cfg.Server.Host); err != nil {
				log.Fatalf("Error starting the server: %s", err)
			}
		}()

		return s.srv.StartAutoTLS(fmt.Sprintf("%s:%d", s.cfg.Server.Domain,
			s.cfg.Server.Port))