microkit
Node.js microservice toolkit
Abstraction toolkit for microservices, to make nodejs developers happy again.
Installation
$ npm install --save microkit
Usage
var MicroKit = ; // Instantiate MicroKitvar microkit = name: 'myAwesomeService' logLevel: 'info' catchGlobal: true // catch global errors queue: name: 'amqp' url: "amqp://localhost" queue: 'myAwesomeService' // queue provider config error: name: 'raven' url: "https://dd..ba:d8..35@app.getsentry.com/24343" // error reporter config stats: name: 'statsd' host: "statsd.example.com" // stats reporter config api: name: 'swagger' services: serviceA: url: 'http://api.domain.com/swagger.yaml' ; /** or for development it will log on stdout * var microkit = new MicroKit({name: 'myAwesomeService'}); **/ // Loggingmicrokitlogger;microkitlogger;microkitlogger;microkitlogger;microkitlogger; var logger = microkitlogger;logger; // Queuemicrokitqueue;microkitqueue;microkitqueue; // Error reportingmicrokiterror; // Metricsmicrokitmetrics; // Exit handlingmicrokit; // Express integration (logging, error reporting)app; // before all middlewaresapp; // after middlewares // API callingmicrokitapi; // configmicrokitconfig; // common errorsconst MyConnectionError = microkiterrorsConnectionError;throw code: 'database_error' error: err;
License
MIT © ProteusLabs