/rest_api_js

Basic REST API to test routes and CRUD functions with JavaScript.

Primary LanguageJavaScript

REST API using JavaScript

This Project uses JavaScript + Node.JS and MongoDB

Tools used in this Project:

Instructions

  1. You can either use node server.js or npm run dev script to start the API;

  2. The base URL is http://localhost:5000/api/patients/;

  3. For HTTP request methods:

    • 3.1. GET api/patients/
    • 3.2. GET api/patients/:id
    • 3.3. POST api/patients/
    • 3.4. PUT api/patients/:id
    • 3.5. DELETE api/patients/:id
  • In order to use npm run dev, install npm install -D nodemon as devDependencies

  • GET, POST, PUT methods return data in json format

  • Replace ':id' with _id string attribute

   {
      "_id": "0a000000000b00000cde00fg",
      ..
   }