It is an API which is made for the Backend Internship.
Server: NodeJS, ExpressJS
DataBase: MongoDB
Clone the project
git clone https://github.com/mohitranjan256/E-Commerce-API.git
Go to the project directory
Install dependencies
Start the server
It is running on the localhost machine on PORT = 5000.
CRUD Operations for Product
Parameter
Type
Description
id
string
Required . id of product to fetch
Parameter
Type
Description
name
string
Required . name of the product
description
string
Required . description of product
price
number
Required . price of product
Parameter
Type
Description
id
string
Required . id of product to update
name
string
name of the product to update
description
string
description of product to update
price
number
price of product to update
Parameter
Type
Description
id
string
Required . id of product to delete
CRUD Operations for Product Variants
Get all variants of product
Get a variant of a product
GET /products/:prid/var/:varid
Parameter
Type
Description
prid
string
Required . id of product to fetch
varid
string
Required . id of variant to fetch
Parameter
Type
Description
prid
string
Required . id of product
name
string
name of the variant
sku
string
description of variant
additionalcost
string
price of variant
stockcount
number
price of variant
UPDATE a variant of a product
PUT /products/:prid/var/:varid
Parameter
Type
Description
prid
string
Required . id of product to update
varid
string
Required . id of variant to update
name
string
name of the variant
sku
string
description of variant
additionalcost
string
price of variant
stockcount
number
price of variant
DELETE a variant of a product
DELETE /products/:prid/var/:varid
Parameter
Type
Description
prid
string
Required . id of product to delete
varid
string
Required . id of variant to delete
Parameter
Type
Description
name
string
Required .name is required name either can be Product name , product description or product variant name