File tree Expand file tree Collapse file tree 5 files changed +40
-6
lines changed
Expand file tree Collapse file tree 5 files changed +40
-6
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ SAP BTP feature toggle library enables Node.js applications using the SAP Cloud
1717 ```
1818
1919- For CAP Feature Toggles everything is configured automatically.
20- - The library acts as a CDS-Plugin and registers a ` FeatureService ` , which is used to check and update toggles.
20+ - The library acts as a CDS-Plugin and registers a ` FeatureService ` , which can be used to check and update toggles.
2121- For details see [ Example CAP Server] ( https://github.com/cap-js-community/feature-toggle-library/blob/main/example-cap-server ) .
2222
2323## Getting Started (Custom Configuration)
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ SAP BTP feature toggle library enables Node.js applications using the SAP Cloud
1818 ```
1919
2020- For CAP Feature Toggles everything is configured automatically.
21- - The library acts as a CDS-Plugin and registers a ` FeatureService ` , which is used to check and update toggles.
21+ - The library acts as a CDS-Plugin and registers a ` FeatureService ` , which can be used to check and update toggles.
2222- For details see [ Example CAP Server] ( https://github.com/cap-js-community/feature-toggle-library/blob/main/example-cap-server ) .
2323
2424## Getting Started (Custom Configuration)
Original file line number Diff line number Diff line change @@ -130,16 +130,39 @@ Get all information about the current in-memory state of all toggles.
130130 " /check/priority" : {
131131 " fallbackValue" : 0 ,
132132 " config" : {
133+ " SOURCE" : " FILE" ,
133134 " TYPE" : " number" ,
134- " VALIDATION" : " ^\\ d+$" ,
135- " ALLOWED_SCOPES" : [" user" , " tenant" ]
135+ " VALIDATIONS" : [
136+ {
137+ " scopes" : [" user" , " tenant" ]
138+ },
139+ {
140+ " regex" : " ^\\ d+$"
141+ },
142+ {
143+ " module" : " $CONFIG_DIR/validators" ,
144+ " call" : " validateTenantScope"
145+ }
146+ ]
136147 }
137148 },
138149 " /memory/logInterval" : {
139150 " fallbackValue" : 0 ,
140151 " config" : {
152+ " SOURCE" : " FILE" ,
141153 " TYPE" : " number" ,
142- " VALIDATION" : " ^\\ d+$"
154+ " VALIDATIONS" : [
155+ {
156+ " regex" : " ^\\ d+$"
157+ }
158+ ]
159+ }
160+ },
161+ " /fts/check-service-extension" : {
162+ " fallbackValue" : false ,
163+ " config" : {
164+ " SOURCE" : " AUTO" ,
165+ " TYPE" : " boolean"
143166 }
144167 }
145168 }
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const { FeatureToggles } = require("@cap-js-community/feature-toggle-library");
2525const instance = new FeatureToggles ({ uniqueName: " snowflake" });
2626```
2727
28- The library prepares a convenient singleton instance of FeatureToggles for out-of-the-box usage, where the Cloud
28+ The library prepares a convenient singleton instance of ` FeatureToggles ` for out-of-the-box usage, where the Cloud
2929Foundry _ app name_ is used as unique name. This should be sufficient for most use-cases and is the default export of
3030the library.
3131
Original file line number Diff line number Diff line change 11# Example CAP Server
22
3+ ## Content
4+
5+ | Topic | Path(s) |
6+ | :--------------------------- | :----------------------------------------------------------- |
7+ | CDS-Plugin Configuration | [ package.json] ( ./package.json ) |
8+ | CDS Configuration | [ .cdsrc.json] ( ./.cdsrc.json ) |
9+ | Feature Toggle Configuration | [ srv/feature/toggles.yaml] ( ./srv/feature/toggles.yaml ) |
10+ | Feature Service Calls | [ http/feature-service.http] ( ./http/feature-service.http ) |
11+ | Check Service Calls | [ http/check-service.http] ( ./http/check-service.http ) |
12+ | CAP Feature Toggle | [ fts/check-service-extension] ( ./fts/check-service-extension ) |
13+
314## CDS and local dependencies
415
516Ideally, we would want to mount our library as a ` file: ` dependency in this sample project. Unfortunately CDS does not
You can’t perform that action at this time.
0 commit comments