Giter Club home page Giter Club logo

fruit-market-server's Introduction

Fruit Market

Introduction

Feira da Fruta (in portuguese: Fruit Market) is an app that i did to train my abilities with Express server and React. In this repo we have the server.

Setup

  • execute yarn or npm install.
  • Create a postgres database and set it's name at ormconfig.json.
  • Set host, port, username and password of that database at ormconfig.json.

Execution

  • execute yarn start

Routes

  • Routes are all configured in index.ts
  • GET "/api/product/:id" to fetch a product
  • POST "/api/product/register" to create a new product
    • Accepts:
      • Format: "application/json"
      • Body Parameters:
        • name: Product's new name
        • category: Product's category (which could be "FRUIT" or "VEGETABLE")
        • price: Product's price (if it's $ 1.00 use 100)
        • imported: Product's origin, Boolean.
  • POST "/api/product/destroy" to remove a product
    • Accepts:
      • Format: "application/json"
      • Body Parameters:
        • id: Product's UUID
  • POST "/api/product/update" to update a product
    • Accepts:
      • Format: "application/json"
      • Body Parameters:
        • id: Product's UUID
        • name: Product's new name
        • category: Product's category (which could be "FRUIT" or "VEGETABLE")
        • price: Product's price (if it's $ 1.00 use 100)
        • imported: Product's origin, Boolean.
  • GET "/api/products" to search for products
    • URL Parameters:
      • q: Name of the product
      • c: Category (which could be "FRUIT" or "VEGETABLE")
      • min: Minimum product price
      • max: Maximum product price
      • imported: if the product is imported

fruit-market-server's People

Contributors

themaxhero avatar

Watchers

James Cloos 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.