Skip to content

Create a box of bricks

bredele edited this page Mar 3, 2014 · 1 revision

See artery for mode information.

  1. Create a box
  2. Communicate through a box
  3. Hooks

Create a box

A brick box is basically a sandbox that allows to create large scale and maintainable applications by splitting into self-contained and small modules. Every module live by its own, is totally independent from an other and communicate with it through an event hub:

var app = require('brick').box();

app.use('chat', chatApp);
app.use('mail',mailApp);

A brick box has an API similar to the famous expressjs.

Communicate through a box

Chat app:

var app = require('brick').box();

app.emit('message', 'hello world');

Mail app:

var app = require('brick').box();

app.on('chat/message', function(){
  //display chat messages
});

Hooks

See artery for mode details.

Clone this wiki locally