Giter VIP home page Giter VIP logo

express-app-docker's Introduction

express-app-docker

Pre-install

  • Node.js

  • Docker Toolbox

  • Mongo DB

Local init

npm install

npm start

Mongo DB command

brew upgrade mongodb

mongod --dbpath ./data/db

mongo

Reset Docker

  • clean all container

docker rm -f $(docker ps -a -q)

  • clean all images

docker rmi -f $(docker images -a -q)

Build

docker-compose build

Run

docker-compose up

docker-compose ps

Start Postman

Users REST API Testing

  • 新增 Post:

    http://<your-ip>:8080/api1/users/

    {"name":"Jack","email":"[email protected]","age":35}

  • 查詢全部 Get:

    http://<your-ip>:8080/api1/users/

    • 查詢結果

    [{"_id":"59f57aac3cc930c28f11beda","name":"Jack","email":"[email protected]","age":39,"__v":0}]

  • 修改 Put:

    http://<your-ip>:8080/api1/users/59f57aac3cc930c28f11beda

    {"name":"Jack","email":"[email protected]","age":39}

  • 刪除 Delete:

    http://<your-ip>:8080/api1/users/59f57aac3cc930c28f11beda

Books REST API Testing

  • 新增 Post:

    http://<your-ip>:8080/api2/books/

    {"name":"Office 2016","author":"Microsoft","price":1000}

  • 查詢全部 Get:

    http://<your-ip>:8080/api2/books/

    • 查詢結果

    [{"_id":"59fda77acd77740011ec27b2","name":"Office 2016","author":"Microsoft","price":1000,"__v":0}]

  • 修改 Put:

    http://<your-ip>:8080/api2/books/59fda77acd77740011ec27b2

    {"name":"Office 2017","author":"Microsoft","price":1200}

  • 刪除 Delete:

    http://<your-ip>:8080/api2/books/59fda77acd77740011ec27b2

Orders REST API Testing

  • 新增 Post:

    http://<your-ip>:8080/api3/orders/

    {"name":"Office 2016","orderer":"Jack","quantity":1,"price":1000,"totalamount":1000}

  • 查詢全部 Get:

    http://<your-ip>:8080/api3/orders/

    • 查詢結果

    [{"_id":"59fda77acd77740011ec27b2","name":"Office 2016","orderer":"Jack","quantity":1,"price":1000,"totalamount":1000,"__v":0}]

  • 修改 Put:

    http://<your-ip>:8080/api3/orders/59fda77acd77740011ec27b2

    {"name":"Office 2016","orderer":"Jack","quantity":1,"price":1200,"totalamount":1200}

  • 刪除 Delete:

    http://<your-ip>:8080/api3/orders/59fda77acd77740011ec27b2

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.