Giter Club home page Giter Club logo

restaurantordersapi's Introduction

NOTES FOR THIS PROJECT

This project is about an API built using NodeJs, Typescript, Docker, MongoDB.

Quickstart

Start by following these terminal commands:

$ git clone https://github.com/RafaelMariscal/jackedPlanner
$ cd api
$ yarn

You can set the both docker and api ports by the constants 'DOCKERPORT' and 'PORT' at index.ts file.

The connection with MongoDB was provided by a docker container, and to make the connection just run theses command lines into terminal:

docker run --name mongo -p 27017:27017 -d mongo
yarn add mongoose

Disclamer

  • The api will only run if it was stablish a conection with MongoDB by mongoose

  • To treat image uploads when creating products, it was used a miltiform request format, and it was used Multer as well

STARTING API

Just follow theses terminal command lines:

$ yarn build
$ yarn start

API Routes

Categories

router.get("/categories", listCategories);

router.post("/categories", createCategory);

Products

router.get("/products", listProducts);

router.post("/products", upload.single("image"), createProduct);

router.delete("/products/:productId", deleteProduct);

Products by Categories

router.get("/categories/:categoryId/products", listProductsByCategory);

Orders

router.get("/orders", listOrders);

router.post("/orders", createOrder);

router.patch("/orders/:orderId", changeOrderStatus);

router.delete("/orders/:orderId", cancelOrder);

restaurantordersapi's People

Contributors

rafaelmariscal 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.