tompave / fun_with_flags_ui

Web dashboard for the FunWithFlags Elixir package
MIT License
128 stars 29 forks source link

How to select DB to read flags #35

Closed Fl4m3Ph03n1x closed 1 year ago

Fl4m3Ph03n1x commented 1 year ago

Background

We are using this UI to check the flags we have on redis. Since Redis has several DBs one can choose from, this raises a problem - we need to tell the UI which Redis DB to use.

Problem

After reading the docs, I couldn't find any option to do that. By default, the UI will always read from Redis DB 1, which is not where our flags are.

Is there a way to tell the UI which Redis DB to use?

tompave commented 1 year ago

Hey there, thank you for using the library.

FWF.UI is just the presentation layer, and in fact it doesn't provide any config option, aside from the way you plug it into your Phoenix or Plug routers.

The persistence layer is provided by the underlying library, fun_with_flags. It supports a number of config options, including the Redis DB number. You can configure it with this:

config :fun_with_flags, :redis, database: 5
Fl4m3Ph03n1x commented 1 year ago

This was not evident to me. Thanks!