2.0.0 • Published 6 months ago

@microservice-framework/microservice v2.0.0

Weekly downloads
2
License
GPL-3.0
Repository
github
Last release
6 months ago

microservice

Gitter npm microservice-frame.work

Microservice framework worker class.

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

Changelog

  • 1.3.0 - open mongo connection on class init, instead of each request.
  • 1.3.1 - bug fix.
  • 1.3.2 - implements events error and ready.
  • 1.3.3-5 - Implementing new access token validation mechanism
  • 1.3.6 - fix Access-token check.
  • 1.3.7 - Add ObjectID like field defenition.
  • 1.3.8 - Fix removing _id from output when _id specified as field.

  • 2.0.0 - Fix search by id when it is array. - support header execution-limit to limit execution time - support header force-index to force index search - support for env MAX_TIME_MS to set max exection time for search - support noCount request params to avoid countin total-count on search - properly close mongo connection on SIGINT (mfw stop serviceName)

2.0.0

6 months ago

1.3.8

6 years ago

1.3.7

6 years ago

1.3.6

6 years ago

1.3.5

6 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.9

6 years ago

1.2.8

7 years ago

1.2.7

7 years ago

1.2.6

7 years ago

1.2.5

7 years ago

1.2.4

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago