Skip to content

K-ennethA/CPSC-449

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CPSC-449

CPSC 449 Back End Engineering Project 1

Janeen Yamak (DevOps), Kenneth Aguilar(Dev 1), Lorena Macias (Dev 2)

Foreman

foreman start -m posts=3,votes=3,caddy=1

Testing

To Test Posts Microservice Run the File

postTest.sh

To Test Votes Microservice Run the File

voteTest.sh

Posts have the form

[
  {
    "id" : "Number",
    "title" : "title",
    "des" : "description",
    "comm" : "community",
    "url" : "url",
    "date" : "YYYY-MM-DD HH:MM:SS"
  }
]

Votes have the form

[
  {
    "id" : "Number",
    "upvotes" : "Number",
    "downvotes" : "Number",
    "total" : "Number",
    "post" : "PostID"
    }
]

Create a Post

Definition

POST /api/v1/resources/posts

Response

  • 201 CREATED if successful
  • 409 CONFLICT if unsuccessful

 

Delete a Post

Definition

DELETE /api/v1/resources/posts/<int:id>

Response

  • 200 OK if successful
  • 404 NOT FOUND if post does not exist

 

Retrieve All Posts

Definition

GET /api/v1/resources/posts/all

Response

  • 200 OK if successful

 

Retrieve Post by ID

Definition

GET /api/v1/resources/posts/<int:id>

Response

  • 200 OK if successful
  • 404 NOT FOUND if post does not exist

 

Retrieve N Most Recent Posts to any Community

Definition

GET /api/v1/resources/posts/recent/<int:num_of_posts>

Response

  • 200 OK if successful
  • 404 NOT FOUND if no posts are found

 

Retrieve N Most Recent Posts by a specific Community

Definition

GET /api/v1/resources/posts/recent/<string:comm>/<int:num_of_posts>

Response

  • 200 OK if successful
  • 404 NOT FOUND if no posts are found

 

Upvote a Post

Definition

POST /api/v1/resources/votes/upvote/<int:id>

Response

  • 200 OK on success
  • 404 NOT FOUND if post does not exist

 

Downvote a Post

Definition

POST /api/v1/resources/votes/downvote/<int:id>

Response

  • 200 OK on success
  • 404 NOT FOUND if post does not exist

 

Report Number of Upvotes and Downvotes for a Post

Definition

GET /api/v1/resources/votes/<int:id>

Response

  • 200 OK on success
  • 404 NOT FOUND if post does not exist

 

List the n Top-Scoring Posts to Any Community

Definition

GET /api/v1/resources/votes/top/<int:num_of_posts>

Response

  • 200 OK on success

 

Given a List of Post Identifiers, Return the List Sorted by Score

Definition

POST /api/v1/resources/votes/list

Response

  • 200 OK on success

 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •