GithubHelp home page GithubHelp logo

rock-son / employee-microservice-node Goto Github PK

View Code? Open in Web Editor NEW

This project forked from omerio/employee-microservice-node

0.0 2.0 0.0 178 KB

Example Node.js CRUD microservice for an Employee entity

Dockerfile 1.20% JavaScript 98.80%

employee-microservice-node's Introduction

employee-microservice-node

CircleCI codecov

Example Node.js CRUD microservice for an Employee entity with unit tests, mocking, code style checking and good test coverage. The microservice exposes REST APIs which are documented using Swagger.

Getting Started

Requirements:

Checkout and run the code

git clone https://github.com/omerio/employee-microservice-node.git
cd employee-microservice-node
npm install
npm start

Once the server is started you can access the following URLs:

Alt text

Libraries

The following libraries are used in this project:

Available build scripts

The available scripts are in the package.json file:

  • npm start - start the application
  • npm run dev - start the application in development mode, e.g. application reloads each time a change is made.
  • npm test - run the unit tests, the results are printed to the screen
  • npm run test-ci - run the unit tests, the results saved to a file to use in a Continous Integration tool
  • npm run test-debug - run the tests enabling debug mode
  • npm run coverage - run the code coverage
  • npm run debug - run the app in debug mode
  • npm run lint - run linting of the application code

Unit Tests and Coverage

To run the unit tests

npm test

The test results are printed to the screen. To produce the test results in junit format use the npm run test-ci script

To generate the code coverage reports:

npm run coverage

The coverage reports are available in HTML format in employee-microservice-node/coverage/index.html

CI-CD

This repository uses CircleCI for continuous integration and deployment. Circle CI configuration is in the circle.yml file

Code coverage results are uploaded to CodeCov.

Docker

This microservice can be built as a docker container. See the Dockerfile

To build a docker image:

docker build -t omerio/employee-microservice-node .

To run the docker image:

docker run -p 8000:8000 omerio/employee-microservice-node

Publish the image to Docker Hub, using your Docker Hub login details:

docker login
docker push omerio/employee-microservice-node

TODO

  • Continuous deployment using CircleCI
  • Add authentication
  • Add JSDocs support

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.