File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ A simple example of feature flags:
1616```
1717from fastapi_featureflags import FeatureFlags, feature_flag, feature_enabled
1818
19- my_ff = FeatureFlags(conf_from_url="https://pastebin.com/raw/4Ai3j2DC")
20- print("Enabled Features:", my_ff .get_features())
19+ FeatureFlags(conf_from_url="https://pastebin.com/raw/4Ai3j2DC")
20+ print("Enabled Features:", FeatureFlags .get_features())
2121
2222
2323@feature_flag("web_1")
@@ -32,8 +32,10 @@ if feature_enabled("web_2"):
3232
3333You can get FF (feature flags) from a file or URL:
3434```
35- FeatureFlags(conf_from_url="https://pastebin.com/raw/4Ai3j2DC")
36- FeatureFlags(conf_from_json="tests/features.json")
35+ FeatureFlags.load_conf_from_url("https://pastebin.com/raw/4Ai3j2DC")
36+ FeatureFlags.load_conf_from_json("tests/features.json")
37+
38+ FeatureFlags.reload_feature_flags()
3739```
3840There is also a handler that recognizes if the "@feature_flag" wrapper is used and the flag is not registered in the config.
3941This way you can also use FF at runtime. Defaults to False, so it's safer if you forget the feature flag in the code.
You can’t perform that action at this time.
0 commit comments