Skip to content

AbduAllahGabbar/Fastify

Repository files navigation

A simplified project about categories and products

Download Tools

Fast Startup

  • Download and run application
    git clone https://github.com/AbduAllahGabbar/Fastify.git ## download source code
    cd Fastify ## to enter the project folder
    npm i ## install all libs
    npm run dev ## run application

To Open MySQL DataBase Manager

To Test API`S on postman

  • open file Fastify.postman_collection.json in postman application

Request Parameters [GET , POST | PUT | Delete] Restful API From Postman

  • Api for Categories

    Method [POST] : URL http://localhost:3100/categories

    // If the category is the top parent, put zero | "0" in "parentId" : "0"
    // If the category has a parent, the parent's ID must be placed in the "parentId"
    
    //Sample Body 
    {
      "name": "Category 1",
      "parentId": "0"
    }

    Method [GET] : URL http://localhost:3100/categories

    Minor categories related with the parent are returned in the
    "nestedCategories" list
    Parent category are returned in the "parentCategory"
    Returns the number of products related with the category in the { "_count":
    {"products": 0} }
  • Api for Products

    Method [POST] : URL http://localhost:3100/products

    // You must put the ID of the category you want to associate with the product in "categoryId"
    
    //Sample Body 
    {
     "name" : "Product",
     "categoryId" : "1cf07109-6531-42d8-8d32-2fc3515fd64d"
    }

    Method [GET] : URL http://localhost:3100/products

    To get products list

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •