diff options
author | Alan Pearce | 2024-05-09 18:24:25 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-09 19:27:57 +0200 |
commit | 14c1ddaf7c5468c5966b0c1585f19a5ff39c206d (patch) | |
tree | 91b7910c62fd9bc2bcf89c78847c311f80827a0d /internal/server | |
parent | fbc4c583a4e2759d6b8cdbb98de2c769918ddac8 (diff) | |
download | searchix-14c1ddaf7c5468c5966b0c1585f19a5ff39c206d.tar.lz searchix-14c1ddaf7c5468c5966b0c1585f19a5ff39c206d.tar.zst searchix-14c1ddaf7c5468c5966b0c1585f19a5ff39c206d.zip |
feat: enable setting config file path via command line
Diffstat (limited to 'internal/server')
-rw-r--r-- | internal/server/server.go | 3 |
1 files changed, 2 insertions, 1 deletions
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") } |