https://github.com/yting27/feature-switches
Manage users’ accesses to new features via feature switches
https://github.com/yting27/feature-switches
java rest-api spring-boot
Last synced: 3 months ago
JSON representation
Manage users’ accesses to new features via feature switches
- Host: GitHub
- URL: https://github.com/yting27/feature-switches
- Owner: yting27
- Created: 2024-05-11T04:34:04.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-11T05:27:37.000Z (about 2 years ago)
- Last Synced: 2024-05-11T06:24:54.842Z (about 2 years ago)
- Topics: java, rest-api, spring-boot
- Language: Java
- Homepage:
- Size: 69.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# feature-switches
## Getting Started
1. Make sure the required tools are installed: [Guide](https://spring.io/guides/gs/spring-boot)
2. Add or edit feature access with `/feature` endpoint (method: POST):
```bash
## Body parameters: featureName, email, enable
curl --location 'localhost:8080/feature' \
--header 'Content-Type: application/json' \
--data-raw '{
"featureName": "edit-profile",
"email": "abc@gmail.com",
"enable": true
}
'
```
Response example:
```
{
"statusCode": "OK",
"hasError": false,
"error": null,
"data": {
"message": "Successfully updated existing feature access (ID: 5)"
}
}
```
3. Query feature access of a user with `/feature` endpoint (method: GET):
```bash
## Query paramaters: email, featureName
curl --location 'localhost:8080/feature?email=abc%40gmail.com&featureName=edit-profile'
```
Response example:
```
{
"statusCode": "OK",
"hasError": false,
"error": null,
"data": {
"canAccess": true
}
}
```