Blog API 📚
Write and read articles!
Deployed at: https://young-hamlet-80803.herokuapp.com/api/v1
Features
- User can create an account and have a profile.
- User can view other users profile.
- User can create articles.
- User can read articles from other authors.
- User can follow and unfollow other users.
- User can favourite and unfavourite an article.
- User can comment and delete comment from an article.
- Users have a feed of the articles written by other users they follow.
Technologies Used
- Node.js
- Express.js
- MongoDB
Installation
-
Make sure you have
nodejs
andmongodb
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. |