https://github.com/harness/ff-mock-server
Feature Flag mock server
https://github.com/harness/ff-mock-server
Last synced: 11 months ago
JSON representation
Feature Flag mock server
- Host: GitHub
- URL: https://github.com/harness/ff-mock-server
- Owner: harness
- License: apache-2.0
- Created: 2021-11-23T11:24:34.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-18T11:44:03.000Z (over 3 years ago)
- Last Synced: 2025-01-03T18:12:12.293Z (about 1 year ago)
- Language: Go
- Size: 57.6 KB
- Stars: 1
- Watchers: 55
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Feature Flag mock server
Very light mock server which serves simple configurations and target groups. Supports streams and metrics validation.
# How to run
```
docker run -d -p 9090:3000 ff-mock-server:latest
// wait until the server starts
docker exec ${ID} /bin/bash /app/wait-for-it.sh
```
# Authentication keys
You need to specify api key to access all api endpoints
* Server key: `2e182b14-9944-4bd4-9c9f-3e859e2a2954`
* Client key: `2e2ecf62-ce53-4e9e-8006-b4db0386688c`
# Default values
```
* environmentUUID: 265597ad-516c-4575-a16f-b3d17adffc44
* defaultClusterIdentifier: cluster
* project: demo
* environment: dev
* flag: bool-flag
* target group: demo
```
# How to use
When server is started sample app can connect and use custom config Url and event Url
```java
final HarnessConnector hc = new HarnessConnector(SDK_KEY, HarnessConfig.builder().configUrl("http://localhost:9090/api/1.0").build(), null);
final CfClient client = new CfClient(hc);
client.waitForInitialization();
final boolean bResult = client.boolVariation("bool-flag", null, false);
assert bResult == true
```
* flag: demo-flag
# Flags
Application Options:
-t, --timeout= Request timeout
-s, --status-code= returns HTTP status code
-m, --message= Message to display in response
-e, --sse= SSE off sequence, -e=10 -e=30 -e=60 means it will go off in 10s, 30s and 60s
-o, --operation= operation (Authenticate, GetFeatureConfig, GetFeatureConfigByIdentifier, GetAllSegments, GetSegmentByIdentifier, GetEvaluations, GetEvaluationByIdentifier, postMetrics, Stream)
Help Options:
-h, --help Show this help message