femicodes / blog-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blog API 📚

Write and read articles!

Deployed at: https://young-hamlet-80803.herokuapp.com/api/v1

Features

  1. User can create an account and have a profile.
  2. User can view other users profile.
  3. User can create articles.
  4. User can read articles from other authors.
  5. User can follow and unfollow other users.
  6. User can favourite and unfavourite an article.
  7. User can comment and delete comment from an article.
  8. Users have a feed of the articles written by other users they follow.

Technologies Used

  1. Node.js
  2. Express.js
  3. MongoDB

Installation

  • Make sure you have nodejs and mongodb installed.

  • Clone repo

      - git clone https://github.com/femicodes/blog-api.git
      - cd blog-api
      - yarn install

API ENDPOINTS

Authentication

URI HTTP Method Description
/api/v1/auth/signup POST Create an account.
/api/v1/auth/login POST Log in to an account.

API Routes

URI HTTP Method Description
/api/v1/feed GET List of articles written by authors a user follows.
/api/v1/profile/:username GET Get a user's profile by username.
/api/v1/profile/:username PATCH Edit user profile.
/api/v1/:username/follow POST Follow another user by username.
/api/v1/:username/unfollow POST Unfollow another user by username.
/api/v1/articles GET Fetch all articles
/api/v1/articles POST Create an article.
/api/v1/articles/:slug GET Get article by slug.
/api/v1/articles/:id DELETE Delete article by id.
/api/v1/articles/:article/comments POST Add comment by article id.
/api/v1/articles/comments/:comment DELETE Delete article comment by comment id.
/api/v1/:article/favourite POST Favourite an article by article id.
/api/v1/:article/unfavourite POST Unfavourite an article by article id.

About


Languages

Language:JavaScript 100.0%