hermes-relay-starter
v0.0.4
Published
Hermes Relay Starter
Downloads
4
Readme
Hermes Relay Starter
An express-based bootstrapping module for building distribution relay services with Node.js. The starter utilises sub-app mounting to provide any implementing express application with a variety of features.
Basic Usage
The following is the most basic usage of the starter, for a more detailed example please refer to the example
directory;
'use strict';
var express = require('express');
var relay = require('hermes-relay-starter');
var app = express();
app.use(relay({
distributionService: require('./services/my-distributor')
}));
app.listen(8000, function onListen() {
log.info('Relay initialised and accepting requests at the following root: http://localhost:8000/starter/relay/v1');
});
Configuration
By placing an app.yml
config file in the /config
directory of an implementing app it is possible to override default options.
default:
#
# Basic
#
server:
port: 8000
#
# Log
#
log:
path: my-log-file.log
#
# Microservice
#
microservice:
basePath: services
server:
name: starter/v1
dependencies: my/other/service/to/monitor/v1
#
# Zookeeper
#
zookeeper:
connectionString: localhost:2181
retry:
wait: 1000
count: 5