File tree 5 files changed +40
-6
lines changed
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
17
17
```
18
18
19
19
- 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.
21
21
- For details see [ Example CAP Server] ( https://github.com/cap-js-community/feature-toggle-library/blob/main/example-cap-server ) .
22
22
23
23
## 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
18
18
```
19
19
20
20
- 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.
22
22
- For details see [ Example CAP Server] ( https://github.com/cap-js-community/feature-toggle-library/blob/main/example-cap-server ) .
23
23
24
24
## 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.
130
130
" /check/priority" : {
131
131
" fallbackValue" : 0 ,
132
132
" config" : {
133
+ " SOURCE" : " FILE" ,
133
134
" 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
+ ]
136
147
}
137
148
},
138
149
" /memory/logInterval" : {
139
150
" fallbackValue" : 0 ,
140
151
" config" : {
152
+ " SOURCE" : " FILE" ,
141
153
" 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"
143
166
}
144
167
}
145
168
}
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const { FeatureToggles } = require("@cap-js-community/feature-toggle-library");
25
25
const instance = new FeatureToggles ({ uniqueName: " snowflake" });
26
26
```
27
27
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
29
29
Foundry _ app name_ is used as unique name. This should be sufficient for most use-cases and is the default export of
30
30
the library.
31
31
Original file line number Diff line number Diff line change 1
1
# Example CAP Server
2
2
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
+
3
14
## CDS and local dependencies
4
15
5
16
Ideally, 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