quarkjs
v0.1.4
Published
A simple micro-service framework for node.js
Downloads
3
Maintainers
Readme
quark
a mini framework for micro-service in node.js
Installation
$ npm install quarkjs
Features
- Simple definition of actions for patterns.
- Fast and minimalist.
- Transports will resolve message sending to other services.
Quick start
$ npm install quarkjs
Example of a ping-pong app:
var quark = require('quarkjs')();
quark.define({
action: 'ping'
}, function(args, done) {
done(null, { yeld: 'pong' });
});
quark.listen(function(err, addr) {
if (err) throw err;
console.log('quark %s is running on %s:%s', 'ping.pong', addr.address, addr.port);
});
Sending messages:
$ curl -d "http://localhost:3000/exec" '{"action" : "ping"}'
# output => { "yeld": "pong" }
Examples
To view the examples, clone the quark repository and install the dependencies.
$ git clone [email protected]:robert52/quark.git
$ cd quark
$ npm install
To run an example us the following command:
$ node examples/ping.pong.js