Merge branch 'master' of gitssh.handmade.network:hmn/hmn

This commit is contained in:
Asaf Gartner 2021-06-25 16:53:27 +03:00
commit 582ad9ee9e
2 changed files with 7 additions and 0 deletions

View File

@ -18,6 +18,7 @@ const (
type HMNConfig struct {
Env Environment
Addr string
PrivateAddr string
BaseUrl string
LogLevel zerolog.Level
Postgres PostgresConfig

View File

@ -3,7 +3,9 @@ package website
import (
"context"
"errors"
"log"
"net/http"
_ "net/http/pprof"
"os"
"os/signal"
"time"
@ -58,6 +60,10 @@ var WebsiteCommand = &cobra.Command{
os.Exit(1)
}()
go func() {
log.Println(http.ListenAndServe(config.Config.PrivateAddr, nil))
}()
logging.Info().Str("addr", config.Config.Addr).Msg("Serving the website")
serverErr := server.ListenAndServe()
if !errors.Is(serverErr, http.ErrServerClosed) {