Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.3 KB

readme.md

File metadata and controls

53 lines (36 loc) · 1.3 KB

Product-Category-API

API to manage products and categories

Getting Started

Prerequisites

Node.js
MongoDB

Installation

1. Clone the repository:

git clone https://github.com/<your-username>/product-category-api.git

2. Install dependencies:

cd product-category-api
npm install

3. Start the server:

node server.js

The API should now be running at http://localhost:3000.

API Endpoints

Products

`GET /products `- Retrieve all products  
`GET /products/:productId` - Retrieve a product by ID  
`GET /productsWithCategories `- Retrieve all products with 	their corresponding category objects  
`POST /products `- Create a new product  
`PUT /products/:productId` - Update a product by ID  
`DELETE /products/:productId` - Delete a product by ID  

Categories

`GET /categories` - Retrieve all categories  
`GET /categories/:categoryId` - Retrieve a category by ID  
`DELETE /categories/:categoryId` - Delete a category by ID  

For API Testing on POSTMAN

POSTMAN Documentation Link

Postman Link