npm.io
0.1.8 • Published 8 years ago

jetstream-microservice

Licence
ISC
Version
0.1.8
Deps
5
Size
277 kB
Vulns
4
Weekly
0

Jetstream microservice

New in v0.1.6

  • Shorten key expiration to 5s
  • Add tests for JWT signing

New in v0.1.1

Inter-service security added

Security now added to contact other services, use the Jetstream's version of request rather than request itself

var jetstream = require('jetstream-microservice');
jetstream.request(options, next);

Remove inbound security

process.env.IGNORE_JWT_SECURITY = "false";

Getting started

Create a Jetstream service easily

You will need Jetstream core up and running to get this to work correctly.

First install express and jetstream-microservice

$ npm install --save express
$ npm install --save jetstream-microservice

Then create a simple index.js file...

var express = require('express');

var app = express();

var jetstream = require('jetstream-microservice');

var port = 5099;

var options = {
    name: "test-service",
    location: "http://localhost:" + port
}

jetstream.init(app, options);

var server = app.listen(port);

And run...

$ node index.js

Running tests

Default with summary only:

$ npm test

To see verbose test output, execute:

$ npm run test:detailed

Keywords