From 0986e8699e87addccbef43c0ce30a466988fed15 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 9 May 2024 18:47:37 +0200 Subject: feat: enable index path to be configured --- 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 1611a7a..8252b8e 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -45,6 +45,7 @@ type Config struct { BaseURL cfg.URL `conf:"default:http://localhost:3000,short:b"` ConfigFile string `conf:"short:c"` LogLevel slog.Level `conf:"default:INFO"` + IndexPath string `conf:"default:data/index.bleve"` } type HTTPError struct { @@ -89,7 +90,7 @@ func New(runtimeConfig *Config) (*Server, error) { } slog.Debug("loading index") - index, err := search.Open(config.DataPath) + index, err := search.Open(runtimeConfig.IndexPath) slog.Debug("loaded index") if err != nil { log.Fatalf("could not open search index, error: %#v", err) -- cgit 1.4.1