1.0.1 • Published 5 years ago

@arunkumarpalaniappan/node-common v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

node-common

Ready to use logger using morgan and winston.

Instructions

npm i node-common

const common = require("node-common")(SERVICE_NAME);

const obj = {

port: process.env.PORT || "4001", // should be configured in env folder

logger: common.logger,

middlewares: common.middlewares

};

app .start(obj) .then(server => { common.logger.appLogger.info(${SERVICE_NAME}:${obj.port} started); }) .catch(err => { common.logger.appLogger.error( Could not start server because of the error ${err}, process.exit(1) ); });

License

MIT