GithubHelp home page GithubHelp logo

akshayprasad / restful-apis Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 2.2 MB

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

JavaScript 100.00%

restful-apis's Introduction

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

restful-apis's People

Contributors

akshayprasad avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.