Giter Club home page Giter Club logo

nodebootstrap-microservice's Introduction

nodebootstrap-microservice

Code Climate Badge NodeSecurity Status

A skeleton of a containerized microservice generated by Node Bootstrap

Developing code in local workspace

Please note: we follow the philosophy of clean separation between "build" and "run" stages.

In the build stage, the Dockerfile is used to build the container image and bring it to a state where it can be run by any execution environment (such as: Swarm, Kubernetes, ECR, etc.) given that the environment will also contextualize it using appropriate environmental variables.

In the run stage execution environment runs the container image built by the Dockerfile. For local development docker-compose.yml takes the role of the executor. it is the simplest solution for the task and we prefer keeping things simple, locally.

Please note that in the local environment code hot-reloading is turned on, so there is no need to restart the container as you develop code, just edit the corresponding files and enjoy the experience!

Run/Stop container:

# run:
> make [start]

# stop:
> make stop

# clean rebuild:
> make clean

Inspecting health of the containers:

> make ps

Monitoring Logs:

> make logs

Debugging

To shell into the container, simply run:

> make shell

Running tests:

> make test

Coverage reports are stored under coverage sub-folder.

Installing a new package

Installing a package (let's assume for package maikai):

make add package=maikai

Install a package in dev-dependencies (let's assume for package mocha):

make add-dev package=mocha

If you add a number of packages in package.json manually (e.g. on the host), you generally want to run make build to rebuild the container or run make clean to stop, rebuild and start.

Database Migrations (Currently: MySQL)

# Create migration:
> npm run migration-create <migration-name>
# e.g.: 
> npm run migration-create create-users-table
# Run migrations:
> make migrate

Accessing the microservice:

http://localhost:5501/

Running Automated Tests

Run: make test

License

MIT

nodebootstrap-microservice's People

Contributors

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