Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

onebeyond/svc-example

Repository files navigation

svc-example

An example service using

Features

  • Environmental configuration
  • Secrets obtained from a runtime location
  • Automatically applies schema changes on startup
  • Orderly startup / shutdown (e.g. establishes database connections before setting up http listeners and vice versa)
  • Graceful shutdown on errors, unhandled rejections, unhandled exceptions, SIGINT and SIGTERM
  • Useful log decorators, including request scoped logging
  • JSON logging to stdout in "proper" environments, human friendly logging locally
  • The Dockerfile uses settings from .npmrc and .nvmrc
  • The docker build cache busts using package.json and npm-shrinkwrap.json so npm install only runs when necessary
  • Deployed artifact (a docker image) is traceable back to SCM commit via manifest.json, exposed via /__/manifest endpoint
  • Unit tests use stubbed clock for predictability
  • Unit tests use stubbed persistence store for speed

Running locally

npm run docker
npm start

Running tests

npm test

About

An example microservice

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published