Skip to content

akshay-singh-github/Sample-RESTful-API-Endpoint-Using-NodeJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample-RESTful-API-Endpoint-Using-NodeJS

RESTful API Endpoint Implementation Overview :


Alt text

Technologies Used:

  1. Front End : AngularJS, HTML, CSS, Bootstrap (Responsive).
  2. Back End : ExpressJS, NodeJS.
  3. Unit Testing : Chai, Mocha.

API Documentation


Alt text

Steps to Compile and Run the code:

  1. Open a Terminal (or Command Prompt for Windows.).
  2. Create a new directory by typing below command in terminal and pressing Enter.
    mkdir Tesing_Sample_API_Implementation
  3. Enter the created directory by typing below command in terminal and pressing Enter.
    cd Tesing_Sample_API_Implementation
  4. Clone the repository with sample on local System by typing below command in terminal and pressing Enter.
    git clone https://github.com/akshaysingh1520/Sample-RESTful-API-Endpoint-Using-NodeJS.git
  5. Enter the cloned code directory (or repository) by typing below command in terminal and pressing Enter.
    cd Sample-RESTful-API-Endpoint-Using-NodeJS
  6. Run the below command in terminal and press Enter to install all the project dependencies.
    npm install -d
  7. Run the below command in terminal and press Enter to start API server.
    node app.js
  8. Open a browser like Google Chrome, Firefox etc. and type below url in the url address bar and press Enter.
    http://localhost:3000/#!/
  9. Below Responsive UI will appear in the browser.
    Alt text
  10. Please enter the valid Latitude, Longitude and Radius, Click on "Search Button" to see the results.
    Alt text

Steps to Run the Unit Tests:

  1. To run Unit tests make sure that the API Server is running. i.e. Steps 1 - 7 mentioned above should be performed at least.
  2. Open a new Terminal and Enter the cloned code directory (Similar to step 5 mentioned above).
  3. After entering the cloned repository i.e. "Sample-RESTful-API-Endpoint-Using-NodeJS", run the below command.
    npm test
  4. All the Unit tests for testing the RESTful API Endpoint are run and results are displayed in terminal. Please see the output in the below image for reference.
    Alt text

Error Handling in UI:

  1. For invalid Latitude.
    Alt text
  2. For invalid Longitude.
    Alt text
  3. For invalid Radius.
    Alt text

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published