Skip to content

mujtaba93/MEAN-stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Mean Stack APP This App has been built on MEAN Stack - MongoDB, Express JS, Node JS and Angular JS. It uses 'gulp' build tool in order to start the node server.

Steps to run the app:

  1. Clone the repository in some location.
  2. Once cloned, you can cd into MEAN-stack folder.
  3. Open command prompt and run npm install in order to install all the dependencies required by the app to run.
  4. Once all the dependencies are installed, you can do gulp to start the node server and navigate to http://localhost:9000 in order to see the UI.

Pre-requisites

  1. You need to have MongoDB and NodeJS installed on your system.
  2. Make sure that mongo shell is up and running.
  3. On starting the server, the app will add few records to the Mongo Table, which will be visible right away.

How to run the API calls

  1. You will need to install Postman, a free Chrome extension. You can get it from here -> https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en
  2. In order to perform GET request, just navigate to http://localhost:9000/api/books/ using Postman.
  3. For POST request, navigate to the same link and add the following to request body (sample)
    {
        "genre": "Fiction",
        "author": "Paulo Coelho",
        "title": "The Alchemist"
    }
  1. For PUT request, navigate to the following link and add the following to request body http://localhost:9000/api/books/{id}

Note: You can get the ID from any of the books by issuing GET command.

    {
        "genre": "Fiction",
        "author": "Paulo Coelho",
        "title": "The Alchemist",
        "read": true
    }
The **read** property will get updated from false to true, keeping all other properties unchanged.
  1. For PATCH request, you will have to get the ID by doing GET command and visit the link - http://localhost:9000/api/books/{id} and add the change to be made to request body. refer below
    {
        "title": "My Book",
    }
  1. In order to DELETE a resource, you need to visit the same link as above and just select DELETE verb from the postman dropdown menu

Running Test cases

  1. The test cases have been written in Protractor, which can be found in tests/e2e folder.

  2. In order to run the test cases, first start the app server from command line by issuing gulp command. Follow all the steps above in order to start the server.

  3. Once you have started the app server, you can issue gulp test command from other console, in order to run the test cases.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors