0.0.3 • Published 6 years ago

getting-started-microservice v0.0.3

Weekly downloads
3
License
-
Repository
-
Last release
6 years ago

Getting Started Microservice

coverage report

pipeline status

This repository provides a template for FAB microservice delivery.

Usage

Fork Template Change Project Name in package.json, API & product definitions files and deploy/deployment.yaml Push to repository and check pipeline passes.

Rules

Changes are to be made in the given folders and follow the router-controller-adapter pattern.

All code needs test coverage!

Code must

Logs

Log messages should follow the given patterns including naming of messages as msg and errors as err:

Debug messages provide additional context in development

logger.debug({ msg: 'Error From DAS Adapter. Returning' });

Info messages provide production logs of non-error events

logger.info({ msg: 'Successfully Created Client' });

Error messages provide context as close to the source of an error as possible.

logger.error({ err, msg: 'Unhandled Error From DAS Adapter' });

Fatal messages provide details of fatal events. Fatal events should stop the server to fail fast.

logger.fatal({ err, msg: `ERROR LOADING SCHEMAS: ${e.message}` });
process.exit(1);

Metrics

Metrics are exposed through the metrics module of fab_utils. Increment with: metrics.increment('clients');