all repos — searchix @ 55efc5bec9703a299de5aac89006ed85600445fc

Search engine for NixOS, nix-darwin, home-manager and NUR users

refactor(config): simplify configuration commit 8225dbdb692c99b39dcafe2e5ec6ddc4daf08fb5 Author: Alan Pearce <alan@alanpearce.eu> Date: Mon May 13 19:18:26 2024 +0200 refactor: consolidate configuration to reduce command-line options commit 5616d4c5a9bc6c0c14f744f812fa6609f859dc34 Author: Alan Pearce <alan@alanpearce.eu> Date: Mon May 13 17:41:58 2024 +0200 refactor: move config file parsing to program entry points

Alan Pearce
commit

55efc5bec9703a299de5aac89006ed85600445fc

parent

37deedc9b1da92571548c920721984d545269eb4

1 file changed, 4 insertions(+), 3 deletions(-)

changed files
M internal/server/server.gointernal/server/server.go
@@ -6,6 +6,7 @@ "log"
"log/slog" "net" "net/http" + "searchix/internal/config" "time" "github.com/pkg/errors"
@@ -15,12 +16,12 @@ type Server struct {
*http.Server } -func New(runtimeConfig *Config) (*Server, error) { - mux, err := NewMux(runtimeConfig) +func New(conf *config.Config, liveReload bool) (*Server, error) { + mux, err := NewMux(conf, liveReload) if err != nil { return nil, err } - listenAddress := net.JoinHostPort(runtimeConfig.ListenAddress, runtimeConfig.Port) + listenAddress := net.JoinHostPort(conf.Web.ListenAddress, conf.Web.Port) return &Server{ &http.Server{