Skip to content

Commit b31590a

Browse files
Tomas-PytelTomas-Pytel
authored andcommitted
Update README.md
1 parent 62d41b9 commit b31590a

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ A simple example of feature flags:
1616
```
1717
from 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

3333
You 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
```
3840
There is also a handler that recognizes if the "@feature_flag" wrapper is used and the flag is not registered in the config.
3941
This way you can also use FF at runtime. Defaults to False, so it's safer if you forget the feature flag in the code.

0 commit comments

Comments
 (0)