all repos — homestead @ de8e02d2a10ce0a01817729e47f31e7b37103af2

Code for my website

split options of website/server

Alan Pearce
commit

de8e02d2a10ce0a01817729e47f31e7b37103af2

parent

5434a11ad1bf6693705a9ba38ec9464f2d001da9

1 file changed, 7 insertions(+), 7 deletions(-)

changed files
M internal/server/server.gointernal/server/server.go
@@ -6,7 +6,6 @@ "fmt"
"net/http" "time" - cfg "go.alanpearce.eu/website/internal/config" "go.alanpearce.eu/x/log" "gitlab.com/tozd/go/errors"
@@ -24,16 +23,16 @@ IdleTimeout = 10 * time.Minute
) type Options struct { - Development bool - ListenAddress string - Port int - TLSPort int - TLS bool + ListenAddress string `conf:"default:localhost"` + Port int `conf:"default:8080,short:p"` + TLS bool `conf:"default:false"` + TLSPort int `conf:"default:8443"` ACMEIssuer string ACMEIssuerCert string - Config *cfg.Config + Domains []string `conf:"-"` + WildcardDomains []string `conf:"-"` } type Server struct {
@@ -61,6 +60,7 @@ }, nil
} func (s *Server) HostApp(app *App) { + s.options.Domains = append(s.options.Domains, app.Domain) s.mux.Handle(app.Domain+"/", app.Handler) }