2.1.2 • Published 10 years ago

redwire-harmony v2.1.2

Weekly downloads
7
License
MIT
Repository
github
Last release
10 years ago

Harmony

Daemon for redwire

Harmony runs a directory full of javascript files as individual redwire instances.

NPM version

Install

npm install -g redwire-harmony

Usage

In a directory with the javascript files you want to run as redwire instances

harmony

To reload any changes send a SIGHUP to the harmony daemon

Example

Save this file into a directory as example.js and run harmony.

module.exports = {
    config: { http: { port: 8888 } },
    bind: function(redwire, bindings) {
        // bindings has http, https, tcp, tls and websocket mounts
        // See documentation for redwire
        bindings
            .http('http://localhost:8888/')
            .use(function(mount, url, req, res, next) {
                res.write('OK');
                res.end();
            });
        bindings
            .http('http://localhost:8888/api')
            .use(function(mount, url, req, res, next) {
                console.log('API CALL');
                next();
            })
            .use(redwire.proxy('http://localhost:9999/api');
    },
    end: function() {
        // clean up any services you are using here
    }
};
2.1.2

10 years ago

2.0.0

10 years ago

1.3.0

10 years ago

1.2.4

10 years ago

1.2.3

10 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.5

10 years ago

1.1.4

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago