Simple RESTful API's for blogging platform
- Create database "blogosphere" or whaterver name you want, in Mysql
- Import "blogosphere.sql" file in the database that you created
- Start your Mysql server
Clone the project
git clone https://github.com/Pushkraj-Space/blogosphere.git
Go to the project directory
cd blogosphere
Install dependencies
npm install
Important : Set up environment variables(.env) file as per your machine set up
Start the server
npm start
To use all below mentioned API's in postman, import "BlogoSphere.postman_collection.json" file as a new collection
Base URL = http://localhost:8081
POST /api/user
Input Format (x-www-form-urlencoded)
firstName:
lastName:
email:
userName:
passkey:
POST /api/user/login
Input Format (x-www-form-urlencoded)
userName:
email:(*optional)
passkey:
GET /api/user/
GET /api/user/:userName
Parameter | Type | Description |
---|---|---|
userName |
string |
user name of any user |
DELETE /api/user/:userName
Parameter | Type | Description |
---|---|---|
userName |
string |
user name of logged in user |
PUT /api/user/:userName
Input Format (x-www-form-urlencoded)
firstName:
lastName:
email:
Parameter | Type | Description |
---|---|---|
userName |
string |
user name of logged in user |
POST /api/blog/
Input Format (x-www-form-urlencoded)
blog_title:
blog_content:
PUT /api/blog/:blog_id
Input Format (x-www-form-urlencoded)
blog_title:
blog_content:
Parameter | Type | Description |
---|---|---|
blog_id |
string |
blog_id of a blog |
DELETE /api/blog/:blog_id
Parameter | Type | Description |
---|---|---|
blog_id |
string |
blog_id of a blog |
GET /api/blog/
GET /api/blog/u/:blog_author
Parameter | Type | Description |
---|---|---|
blog_author |
string |
The user who posted that blog |
GET /api/blog/:blog_id
Parameter | Type | Description |
---|---|---|
blog_id |
string |
blog_id of a blog |
POST /api/comment/:blog_id
Input Format (x-www-form-urlencoded)
cmt_text:
Parameter | Type | Description |
---|---|---|
blog_id |
string |
blog_id of a blog where user wants to comment |
PUT /api/comment/:cmt_id
Input Format (x-www-form-urlencoded)
cmt_text:
Parameter | Type | Description |
---|---|---|
cmt_id |
string |
id of a comment user wants to edit/update |
DELETE /api/comment/:cmt_id
Parameter | Type | Description |
---|---|---|
cmt_id |
string |
id of a comment user wants to delete |
GET /api/comment/:blog_id
Parameter | Type | Description |
---|---|---|
blog_id |
string |
blog id of a blog |