@microservice-framework/microservice-cluster

1.2.4 • Public • Published

microservice-cluster

Gitter npm microservice-frame.work

Microservice framework Cluster wrapper that spin up instances of Microservice.

Simple example:

'use strict';

const Cluster = require('@microservice-framework/microservice-cluster');
const Microservice = require('@microservice-framework/microservice');

require('dotenv').config();

var mservice = new Microservice({
  mongoUrl: process.env.MONGO_URL + process.env.MONGO_PREFIX + process.env.MONGO_OPTIONS,
  mongoTable: process.env.MONGO_TABLE,
  secureKey: process.env.SECURE_KEY,
  schema: process.env.SCHEMA
});

var mControlCluster = new Cluster({
  pid: process.env.PIDFILE,
  port: process.env.PORT,
  hostname: process.env.HOSTNAME,
  count: process.env.WORKERS,
  callbacks: {
    validate: mservice.validate,
    POST: mservice.post,
    GET: mservice.get,
    PUT: mservice.put,
    DELETE: mservice.delete,
    SEARCH: mservice.search
  }
});

For more details please check our website

Readme

Keywords

Package Sidebar

Install

npm i @microservice-framework/microservice-cluster

Weekly Downloads

1

Version

1.2.4

License

GPL-3.0

Unpacked Size

48.9 kB

Total Files

8

Last publish

Collaborators

  • microservice-framework