This is the User API Service for the Study Buddy webapp. This service will maintain user information and manage authentication/login.
docker-compose build
docker-compose up
docker-compose down
docker-compose down --volumes
- Download Postman https://www.postman.com
- Utilize GET, POST, PUT, DELETE according to specs below
- Use "Params" and "Body" options where applicaple
- For the "Body" tab, make sure you're using JSON
- Validate Response section
docker build . -t dnyf-user-api
docker run -d -p 4103:4103 --name dnyf-user-api \
-e DB_HOST='<DB host url>' \
-e DB_USER='<DB username>' \
-e DB_PASS='<DB password>' \
-e DB='<DB name>' \
dnyf-user-api
Fetch list of all users:
GET /users
Parameters:
page_number, page_count
Example call:
/users?page_number=0&page_count=1
Response body:
{
{
"total": integer,
"records": {
"uid": "string",
"first_name": "string",
"last_name": "string"
},
"links": {
"href": "string",
"rel": "string",
"type": "GET"
}
"total_pages": integer,
"current_page": integer
}
}
Create new user:
POST /users
Request Body:
{
"uid": "string",
"first_name": "string",
"last_name": "string"
}
Get specified user:
GET /users/{uid}
Parameters:
"uid": "string"
Response body:
{
"uid": "string",
"first_name": "string",
"last_name": "string"
}
Delete users
DELETE /users/{uid}
Parameters:
"uid": "string"
Update users
PUT /users/{uid}
Parameters:
"uid": "string"
Response body:
{
"first_name": "string",
"last_name": "string"
}