To install this:
- RUN
npm i
- Rename
.env.example
to.env
, and update the values accordingly.
To run this service:
Run this command: docker-compose up --build
If database dependecies are not yet initialized, run the seeder
To stop this service:
Run this command: docker-compose down
- SSH into docker container using Kitematic or run:
docker exec -ti {node_container_name} /bin/sh
through commandline - Run the command
npm run scripts:seeder
(can be skipped if tables and their data were already initialized) - Run the command
npm test
Response:
{
"message": "Here are the comments",
"data": ["Test", "New Comment"]
}
Request Body:
{
"comment": "New comment"
}
Response:
{
"message": "Successfully added new comment",
"data": null
}
Response:
{
"message": "Successfully soft deleted comments",
"data": null
}
Response:
{
"message": "Here are the members",
"data": [{
"user_id": 1,
"user": {
"name": "Yun Lang",
"email": "y.lang@gmail.com",
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/thehacker/128.jpg",
"followers_count": 2,
"following_count": 0
}
},
{
"user_id": 2,
"user": {
"name": "Wag Yan",
"email": "w.yan@gmail.com",
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/thehacker/128.jpg",
"followers_count": 1,
"following_count": 0
}
}]
}