update readme
This commit is contained in:
parent
75402c90cd
commit
e69c626fda
52
README.md
52
README.md
|
@ -22,15 +22,61 @@ docker-compose up -d
|
|||
|
||||
The app runs automatically on the port defined in `SERVICE_PORT` of `.env` file (default : _3001_).
|
||||
|
||||
## Usage
|
||||
|
||||
The app exposes the following [gRPC](https://grpc.io/) services :
|
||||
|
||||
- **FindByUuid** : find a user by its uuid
|
||||
|
||||
```json
|
||||
{
|
||||
"uuid": "80126a61-d128-4f96-afdb-92e33c75a3e1"
|
||||
}
|
||||
```
|
||||
|
||||
- **FindAll** : find all users; you can use pagination with `page` (default:_1_) and `perPage` (default:_10_)
|
||||
|
||||
```json
|
||||
{
|
||||
"page": 1,
|
||||
"perPage": 10
|
||||
}
|
||||
```
|
||||
|
||||
- **Create** : create a user (note that uuid is optional, a uuid will be automatically attributed if it is not provided)
|
||||
|
||||
```json
|
||||
{
|
||||
"email": "jezabel.doe@email.com",
|
||||
"firstName": "Jezabel",
|
||||
"lastName": "Doe"
|
||||
}
|
||||
```
|
||||
|
||||
- **Update** : update a user
|
||||
|
||||
```json
|
||||
{
|
||||
"firstName": "Jezabel-Katarina",
|
||||
"email": "jezabel-katarina.doe@email.com",
|
||||
"uuid": "30f49838-3f24-42bb-a489-8ffb480173ae"
|
||||
}
|
||||
```
|
||||
|
||||
- **Delete** : delete a user by its uuid
|
||||
|
||||
```json
|
||||
{
|
||||
"uuid": "80126a61-d128-4f96-afdb-92e33c75a3e1"
|
||||
}
|
||||
```
|
||||
|
||||
## Test
|
||||
|
||||
```bash
|
||||
# unit tests
|
||||
docker exec v3_user sh -c "npm run test"
|
||||
|
||||
# e2e tests
|
||||
docker exec v3_user sh -c "npm run test:e2e"
|
||||
|
||||
# test coverage
|
||||
docker exec v3_user sh -c "npm run test:cov"
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue