Skip to content

Latest commit

 

History

History
41 lines (33 loc) · 1.63 KB

README.md

File metadata and controls

41 lines (33 loc) · 1.63 KB

Primality

Build Status Coverage Status License

A complete TDD setup of Node.js + Express server development

What's in repo?

  1. A Node.js + Express server which check if a number is prime or not
  2. Unit testing using mocha and chai assertion library
  3. Code coverage using nyc, travis, coveralls
  4. Travis build configuration
  5. Containerize server using docker
  6. Auto deployment of docker image to docker hub
  7. Auto deployment of server to Heroku

How does it work?

This microservice server reads the number in the request query and does a primality check of that number. It responses a json indicating the number is a prime or not.

Deployment

In Hekuro environment

  1. Go to https://nodejs-primality.herokuapp.com/primality/197 in your browser or by other means
  2. The http response is { "Number": "197", "Primality": true }

In Docker environment

  1. Install docker in your box
  2. Execute "Docker run -p 3000:3000 --name primality jerrytfleung/primality"
  3. Go to http://localhost:3000/primality/197 in your browser or by other means
  4. The http response is { "Number": "197", "Primality": true }
  5. Execute "Docker stop primality" to stop the server