Skip to content

“Insert product and Place Order” System for an E-commerce website.

Notifications You must be signed in to change notification settings

ahsanshakil-baust/API_Response

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

“Insert product and Place Order” System for an E-commerce website.

A brief description to get all response as a json object

Packages used

npm i express jsonwebtoken bcryptjs multer pg

Connect with database

const Pool = require("pg").Pool;

const pool = new Pool({
    user: "postgres",
    password: "123456",
    database: "postgres",
    host: "localhost",
    port: 3600, //default 5432
});

API Reference

Register an user

  POST : /register
  • For register an user need to pass this parameters

    name,email,password,gender,age

  • Or pass it like a json object with postman Body

      {
          "name":"example",
          "email":"example@example.com",
          "password":"example",
          "gender":"male",
          "age":25,
      }
    

Login an user

   POST : /login
  • For register an user need to pass this parameters

    email,password

  • Or pass it like a json object with postman Body

      {
          "email":"example@example.com",
          "password":"example"
      }
    

Insert Product Category

   POST : /productCategory
  • For register an user need to pass this parameters

    categoryname, categorydescription

  • Or pass it like a json object with postman Body

      {
          "categoryname":"mobile",
          "categorydescription":"All Brands available"
      }
    

Get all Product Category

   GET : /productCategory

Insert Products

   POST : /product
  • For register an user need to pass this parameters

      category_Id, name, description, price
    
  • Also upload a image file for productImage

    Image will be store as a buffer data

  • Or pass it like a form-data with postman Body

    POSTMAN!

Get all Products

   GET : /product

place an order

   POST : /product/:id
  • For register an user need to pass product id as a params

    /product/productId
    
  • Also need to pass a verified token by params or as a json object postman Body

    This token used to authenticate an user whether user is logged in or not.

      {
          "token":"token"
      }
    

Get all orders

   GET : /orderedlist
  • Need to pass a verified token by params or as a json object postman Body

    This token used to authenticate an user whether user is logged in or not.

      {
          "token":"token"
      }
    

About

“Insert product and Place Order” System for an E-commerce website.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published