Giter Site home page Giter Site logo

mongo-express's Introduction

Steps for using this API

1. Download MongoDB

https://docs.mongodb.com/manual/administration/install-community/

2. Run These commands in the root of the folder

npm i - loads

mongod - starts mongodb

npm start - starts the node server

3. Download Postman

https://www.getpostman.com/

After installing and opening Postman, requests can be made for the following restful routes

Trucks
POST

http://localhost:8080/api/trucks Add the following JSON into the body Select the Raw check box, and make sure to select JSON from the dropdown

{
        "model": "International Harvester",
        "year": 2014,
        "licenseNo": "ABC1234",
        "companyName": "Bob's Freight",
        "driverName": "Bob",
        "phoneNumber": "+447577777777",
        "emailAddress": "[email protected]"
}
GET

http://localhost:8080/api/trucks

PUT

http://localhost:8080/api/trucks/:id Add the following JSON into the body Select the Raw check box, and make sure to select JSON from the dropdown

{
        "model": "Mercedez",
        "year": 2018,
        "licenseNo": "CBA1234",
        "companyName": "Bob's Freight",
        "driverName": "Bob",
        "phoneNumber": "+447577777777",
        "emailAddress": "[email protected]"
        
}
DELETE

http://localhost:8080/api/trucks/:id

Locations
POST

http://localhost:8080/api/trucks/:id/locations Add the following JSON into the body Select the Raw check box, and make sure to select JSON from the dropdown

{
        "lat": 50,
        "lng": 1
}
Index

http://localhost:8080/api/trucks/:id/locations After you have created a location take the id from a truck that has been created and fill the :id with its string.

Link to Postman collection of requests https://www.getpostman.com/collections/5520441fc7f2b6dc3e1b

mongo-express's People

Contributors

mardzy avatar

Watchers

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