Skip to content

This is a Node.js API for displaying electric gadget product information. Currently, it focuses on phone products, but it can be easily extended to handle other categories.

Notifications You must be signed in to change notification settings

PerezChris99/NodeJs-REST-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js Product API - Readme

This is a Node.js API for displaying product information. Currently, it focuses on various electric gadgets, but it can be easily extended to handle other categories.

Features

  • List Products: Retrieve a list of all available products.

  • Product Details: Get detailed information about a specific product by its ID.

Technologies

  • Node.js: JavaScript runtime environment used to build the API.

  • Express.js: This will be utilized in the next project.

Installation

  1. Bashgit clone https://github.com/PerezChris99/NodeJs-REST-API Use code with caution.content_copy

  2. Bashcd product-apinpm install Use code with caution.content_copy

Usage

  1. Bashnpm start Use code with caution.content_copy

  2. The API will be running on the default port (usually 3000). You can interact with it using tools like Postman or by sending HTTP requests directly.

Endpoints

  • GET /products - Returns a list of all products in JSON format.

  • GET /products/:id - Returns details of a specific product with the given ID in JSON format.

Example Usage (using Postman):

  1. GET Products:

    • Set the request method to GET.

    • Set the URL to http://localhost:5000/products.

    • Send the request. The response will be a JSON array containing all products.

  2. GET Product Details:

    • Set the request method to GET.

    • Set the URL to http://localhost:5000/products/1 (replace 1 with the actual product ID).

    • Send the request. The response will be a JSON object containing details of the specified product.

Contribution

We welcome contributions to this project! Please feel free to fork the repository and submit pull requests with your improvements.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

This is a Node.js API for displaying electric gadget product information. Currently, it focuses on phone products, but it can be easily extended to handle other categories.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published