Skip to content

REST API's are constructed using a web framework express and database mongoDB. It has a simple todoList API's.

Notifications You must be signed in to change notification settings

akshayprasad/RESTful-APIs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RESTful-APIs

What is REST?

REST is an acronym for Representational State Transfer. It is web standards architecture and HTTP Protocol. The REST architectural style describes six constraints that were originally communicated by Roy Fielding in his doctoral dissertation and defines the basis of RESTful-style as:

  • Uniform Interface
  • Stateless
  • Cacheable
  • Client-Server
  • Layered System
  • Code on Demand (optional)

RESTful applications use HTTP requests to perform Create, Read, Update and Delete operations.

Tools required:

  1. Node.js
  2. MongoDB
  3. Text editor(Visual Studio, Atom, Sublime, etc)
  4. Postman

Kick starting

We are working on creating REST API's. Let's work on creating RESTful todo List API. Basically, creating CRUD (Create, Read, Update and Delete) operations.

Pre-requisites

NodeJs and MongoDB should be installed in the system.

Version installed in the system can be tested out using the following commands:

  npm -v
  mongo --version

Run

  type command 'mongod' in the terminal
  'npm run start' in another terminal

Open Postman in the system

  1. GET - http://localhost:3000/tasks, initially you will see '[]' empty array.
  2. POST - http://localhost:3000/tasks and select 'x-www-form-urlencoded' and enter 'name' as key and 'My first todo list' as value.
  3. GET - http://localhost:3000/tasks, initially you will see the list added in the 2nd step.
  4. GET - http://localhost:3000/tasks/:id, Provides an individual task present in the complete list.
  5. PUT - http://localhost:3000/tasks/update/:id, send a name in the request body.
  6. DELETE - http://localhost:3000/tasks/delete/:id, deletes the record from the list

About

REST API's are constructed using a web framework express and database mongoDB. It has a simple todoList API's.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published