as a workaround I refactored the getting started code to pass backend.Setup(config.Current) instead, something like this:
config.Current := config.LoadConfig() // first get from environment and then override as needed
config.Current.AppEnv = "dev"
config.Current.DataStore = "PostgreSQL"
config.Current.DatabaseURL = "postgres://user:password@localhost:5432/postgres?sslmode=disabled"
config.Current.RedisURL = "redis://localhost:6379"
config.Current.LocalStorageURL = "http://localhost:8099"
backend.Setup(config.Current)
Describe the bug When following the quick-start for the importing and using as a client library, I noticed that when calling
backend.Setup(cfg)
it wasn't picking up theRedisURL
I had set. https://github.com/staticbackendhq/core/blob/5482c6957dcf54f79bb298a99aabd91d42484f30/backend/backend.go#L16Turns out that
backend.Setup(cfg)
eventually sets up the cache by looking atconfig.Current
https://github.com/staticbackendhq/core/blob/5482c6957dcf54f79bb298a99aabd91d42484f30/cache/cache.go#L30as a workaround I refactored the getting started code to pass
backend.Setup(config.Current)
instead, something like this: