Giter Site home page Giter Site logo

expressjs_mongo_project's Introduction

expressjs_mongo_project

A RESTful API using MongoDB and ExpressJS.

Tools Used:

  1. Mongoose
  2. ExpressJS
  3. Nodemon

How To Run:

  1. In your mongoDB create a database called "cantiin"
  2. run these commands:
npm install
npm start

Schemas:

There are 2 Schemas.

1) Product:

Fields:

  1. _id
    • This is the id to access any product
  2. name
    • Type: String
    • required: true
    • Minimum Length: 3 letters
    • Maximum Length: 200 letters
  3. price
    • Type: Number
    • required: true
    • Minimum Value: .01
    • Maximum Value: 1000000
  4. description
    • Type: String
    • required: true
    • Minimum Length: 5 letters
    • Maximum Length: 1000 letters

2) Order:

Fields:

  1. _id
    • This is the id to access any product
  2. product_id
    • Type: ObjectId (Relationship with Product)
    • The ID of the Product related to this order
    • The product must exist in the database
  3. amount
    • Type: Number
    • required: true
    • Minimum Value: .01
    • Maximum Value: 1000000

Endpoints:

A) Ping Endpoint:

This endpoint will display Hello World.
This endpoint is created only to make sure that the project is working.

B) Product Endpoints:

This endpoint will display a list of the products in the database.
They will be displayed as JSON.

This endpoint will add a new product.

This endpoint will display the product with this id.

To delete the product with this ID.

To update the product with this ID.

C) Order Endpoints:

expressjs_mongo_project's People

Stargazers

Peter Macharia Mbae avatar HaziimYassien avatar

Watchers

James Cloos avatar Omar Magdy 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.