CPSC 449 Back End Engineering Project 1
foreman start -m posts=3,votes=3,caddy=1
To Test Posts Microservice Run the File
postTest.sh
To Test Votes Microservice Run the File
voteTest.sh
[
{
"id" : "Number",
"title" : "title",
"des" : "description",
"comm" : "community",
"url" : "url",
"date" : "YYYY-MM-DD HH:MM:SS"
}
]
[
{
"id" : "Number",
"upvotes" : "Number",
"downvotes" : "Number",
"total" : "Number",
"post" : "PostID"
}
]
Definition
POST /api/v1/resources/posts
Response
201 CREATED
if successful409 CONFLICT
if unsuccessful
Definition
DELETE /api/v1/resources/posts/<int:id>
Response
200 OK
if successful404 NOT FOUND
if post does not exist
Definition
GET /api/v1/resources/posts/all
Response
200 OK
if successful
Definition
GET /api/v1/resources/posts/<int:id>
Response
200 OK
if successful404 NOT FOUND
if post does not exist
Definition
GET /api/v1/resources/posts/recent/<int:num_of_posts>
Response
200 OK
if successful404 NOT FOUND
if no posts are found
Definition
GET /api/v1/resources/posts/recent/<string:comm>/<int:num_of_posts>
Response
200 OK
if successful404 NOT FOUND
if no posts are found
Definition
POST /api/v1/resources/votes/upvote/<int:id>
Response
200 OK
on success404 NOT FOUND
if post does not exist
Definition
POST /api/v1/resources/votes/downvote/<int:id>
Response
200 OK
on success404 NOT FOUND
if post does not exist
Definition
GET /api/v1/resources/votes/<int:id>
Response
200 OK
on success404 NOT FOUND
if post does not exist
Definition
GET /api/v1/resources/votes/top/<int:num_of_posts>
Response
200 OK
on success
Definition
POST /api/v1/resources/votes/list
Response
200 OK
on success