From 14c1ddaf7c5468c5966b0c1585f19a5ff39c206d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 9 May 2024 18:24:25 +0200 Subject: feat: enable setting config file path via command line --- internal/server/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal/server') diff --git a/internal/server/server.go b/internal/server/server.go index 5def347..f15d011 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -43,6 +43,7 @@ type Config struct { ListenAddress string `conf:"default:localhost"` Port string `conf:"default:3000,short:p"` BaseURL cfg.URL `conf:"default:http://localhost:3000,short:b"` + ConfigFile string `conf:"short:c"` } type HTTPError struct { @@ -81,7 +82,7 @@ func applyDevModeOverrides(config *cfg.Config) { func New(runtimeConfig *Config) (*Server, error) { var err error - config, err = cfg.GetConfig() + config, err = cfg.GetConfig(runtimeConfig.ConfigFile) if err != nil { return nil, errors.WithMessage(err, "error parsing configuration file") } -- cgit 1.4.1