Skip to content

CRUD-API operations using MongoDb database with (Nodejs and Express app). simple posting blog ( Creating,Reading,Updating and Deleting from a database) with API end-points.

Notifications You must be signed in to change notification settings

purewebstar/nodejs-CRUD-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRUD API DEMO

Simple demonstration of Creating , Reading, Updating and Deleting Api data from MongoDb

Prerequisite:

  • npm/nodejs latest version
  • REST Client Extension for Visual Studio OR POSTMAN

Technologies used:

1. Backend

  • Nodejs
  • ExpressJs
  • MongoDb

2. For Api testing

  • Rest Client

Dependency install

npm install --save

Dependencies are:

express, cors, nodemon, mongoose, dotenv, helmet

Run Project

npm run start

Or

nodemon app.js

Rest Client Api testing (POSTMAN)

Reading API ENDPOINTS

###
// Find all posts
GET http://localhost:4000/post
Content-Type: application/json

// Find post by Id
###
GET http://localhost:4000/post/:id
Content-Type: application/json

// Find post by title
###
GET http://localhost:4000/post/title/:title
Content-Type: application/json

###

Creating API ENDPOINTS

###
// create post
POST http://localhost:4000/post
Content-Type: application/json

{
    "title": "CRUD",
    "description": "Performing a CRUD operation using Nodejs, ExressJs and MongoDb"
}

###

Updating API ENDPOINTS

// update post
###
PUT http://localhost:4000/post/:id
Content-Type: application/json

{
     "title": "CRUD Operations",
     "description": "Designing Api's using NodeJs, ExpressJs and MongoDb"
}

###

Deleting API ENDPOINTS

// delete post
###
DELETE http://localhost:4000/post/:id
Content-Type: application/json

About

CRUD-API operations using MongoDb database with (Nodejs and Express app). simple posting blog ( Creating,Reading,Updating and Deleting from a database) with API end-points.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published