Skip to content

This repo consists of the backend for a blogging site. It has two main routes one for user and other one for blogs.

Notifications You must be signed in to change notification settings

Konark-2ez/BloggingApp-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BloggingApp-Backend

This is a backend developed for a Blogging site using nodejs, expressjs and mongoDB. It has several routes mainly divided into two parts- 1) User Route , 2) Blog Route.

Installation

Install dependencies with npm

  npm install express,nodemon,dotenv,mongoose,bcrypt,jsonwebtoken

Running Tests

To run tests, run the following command

  npm run server

after that postman or thunder client can be used to run the API's

API Reference

Register users

 POST /users/register
Parameter Type Description
http//:localhost:3000/users/register string Required. This will help to register users and save it to database.

Login users

  POST /users/login
Parameter Type Description
`` string Required. http//:localhost:3000/users/login this will login the user and generate a token and a refresh token.

Logout

  POST /users/logout

T| Parameter | Type | Description | | :-------- | :------- | :-------------------------------- | | `` | string | Required. http//:localhost:3000/users/logout this will logout the user and store the token in blacklist.|

Post blogs

  POST /blogs/post

T| Parameter | Type | Description | | :-------- | :------- | :-------------------------------- | | `` | string | Required. http//:localhost:3000/blogs/post this will post new blogs and save it to database.|

get blogs

  GET /blogs/get

T| Parameter | Type | Description | | :-------- | :------- | :-------------------------------- | | `` | string | Required. http//:localhost:3000/blogs/get this will get all the post the user has created and display it.|

update blogs

  PATCH /blogs/update/${blogID}

T| Parameter | Type | Description | | :-------- | :------- | :-------------------------------- | | `` | string | Required. http//:localhost:3000/blogs/update/${blogID} this will update the post the user has created using the id of the blog and display it.|

update blogs

  DELETE /blogs/delete/${blogID}

T| Parameter | Type | Description | | :-------- | :------- | :-------------------------------- | | `` | string | Required. http//:localhost:3000/blogs/delete/${blogID} this will delete the post the user has created using the id of the blog.|

update blogs

  DELETE /blogs/deleteMod/${blogID}

T| Parameter | Type | Description | | :-------- | :------- | :-------------------------------- | | `` | string | Required. http//:localhost:3000/blogs/deleteMod/${blogID} this will delete the post the user has created using the id of the blog.It is only accessible by Moderator|

About

This repo consists of the backend for a blogging site. It has two main routes one for user and other one for blogs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published