Giter Club home page Giter Club logo

node-api_cart-coupons's Introduction

node-api_cart-coupons

Projeto desenvolvimento de Api de Carrinho de Compras com Crud de Produtosn Cupons e Calculo de Descontos Baseado nos Cupons Ultilizados no Carrinho.
RESTful
MVC

Install
npm install

Create .env
PORT=3000
SESSION_SECRET_KEY= sua key aleatoria

POSTGRES_DB=apiloja
POSTGRES_USER= seu user
POSTGRES_PWD= sua password
POSTGRES_PORT=5432
POSTGRES_HOST=127.0.0.1

Run Migrations
npx sequelize-cli db:migrate

Run Api
npm run dev

API Documentation
Link: https://documenter.getpostman.com/view/20194488/UyxojQMa

Product Routes
router.get("/products", productController.getAllProducts)
Get Products List
router.post("/products", productController.addProduct)
Crate new product
router.get("/products/:id", productController.findOneProductById)
Get one product by id
router.put("/products/:id", productController.editProduct)
Edit Pproduct by id
router.delete("products/:id", productController.deleteProduct)
Delete product by id

Coupons Routes
router.get("/coupons", productController.getAllProducts)
Get coupons List
router.post("/coupons", productController.addProduct)
Crate new coupon
router.get("/coupons/:slug", productController.findOneProductById)
Get one coupon by tag
router.put("/coupons/:slug", productController.editProduct)
Edit coupon by tag
router.delete("coupons/:slug", productController.deleteProduct)
Delete coupon by tag

Cart Routes
router.get("/carts", cartController.getAllCarts)
Get carts list
router.post("/carts", cartController.addNewCart)
Create new cart
router.get("/carts/products", cartController.findOneCartBySessionId)
Get one cart by id
router.post("/carts/products", cartController.addCartItem)
Add Product to cart
router.put("/carts/products", cartController.editCartItem)
Edit on cart product by id
router.delete("/carts/products", cartController.deleteCartItem)
Delete cart product by id

node-api_cart-coupons's People

Contributors

vnysrc avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.