/reddit-in-memory

Learn to make reddit CRUD Rest API using in memory database

Primary LanguageJavaScript

reddit-in-memory

Create a new topic

endpoint: POST - /create

Only accept title, and content key e.g

  {
    title: 'New post',
    content: 'lorem ipsum dolor'
  }

any other key specified will return error

Get all topics

Display all available topics

endpoint:

GET - /

GET - /show

Get topic by index

endpoint: GET - /topics/:index

Remove topic by index

endpoint:

DELETE - /topics/:index

Upvote

endpoint: PUT - /upvote:index

Downvote

endpoint: PUT - /downvote:index

Possible Todos

  • add remove topic
  • add sort topic feature
  • root route display all topics
  • add get single topic route