Skip to content

Files

Failed to load latest commit information.

Latest commit

 Cannot retrieve latest commit at this time.

History

History

part_3

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

web_api_nodejs

Part 3: Creating Web API in Node.js

⭐ What is an API ?

API stands for Application Programming Interface. It is a piece of software that can be used by another piece of software, to allow applications to talk to each other.

Web API in particular simply refers to an app that sends data to a client whenever a request comes in. Here, we have client and server talking to each other through the API.

In this part, we have created a simple Web API, using JSON data from a file.

To understand more about creating the web server, you may refer part 1.

To understand more about implementation of Routes in Node, you may refer part 2.

🚀 Get Started

  1. Clone or download the repository.

  2. Once you've downloaded the repo, Open it in an editor of your choice.

  3. Open the terminal and traverse to part_2 directory.

  4. Now run command node index.js to start the server.

  5. Open your browser and go to 127.0.0.1:8000 to see your server running.

  6. Go to 127.0.0.1:8000/api, to test the working of the API. Refer to dev-data/apiData.json to see the dummy JSON data that we have used.

📝 Learn More

To Learn more about how to build an API in Node.js, you may refer this article.