layar-client
v0.2.0
Published
Tiny wrapper around websocket for easily connecting to layar server
Downloads
13
Readme
layar-client
Tiny wrapper around websocket for easily connecting to layar server
Installation
$ npm install layar-client --save
Usage
var lc = require('layar-client');
var client = lc('http://layar.server.com')
// create a multiple section
var configSection = client('config_update');
var releaseSection = client('release_web');
// start a section
var currentHost = 'web01';
var info = { username: 'semmatabei', commitHash: '1fbb8fe' };
releaseSection.start(currentHost, info);
// end a section
// default status is 'completed'
releaseSection.end();
// or specify custom status
releaseSection.end('stopped');
// and add additional info
releaseSection.end('failed', { info: 'failed to do something '});
// send log
var logMessage = 'switching web01 traffic';
releaseSection.log(logMessage);
// abort section
// internally .abort() uses .end() with 'error' status
var errorMessage = 'failed to switch web01 traffic';
releaseSection.abort(errorMessage);