monostack

MONOSTACK, a modular Node.JS stackful architecture

npm install monostack
30 downloads in the last week
88 downloads in the last month

MONOSTACK is a modular stackful architecture and convention for building scalable, organized, well-structured and interconnected Node.JS components and projects.

Quick Start

Installation

$ npm install monostack

Quick Start

Inside an empty directory, type:

$ mst --new

Examples

Simple HTTP Server

requires http package - install using mspm install http


var mst = require('monostack')

mst.once("loadModule", function (e,serverName,server) {
    server.e.log('done')
})

mst.addServer('.')

Then create a config.json with this configuration:

{
    "components": {
        "http": {
            "class": "Http",
            "express": true,
            "listen":[80]
        }
    }
}

HTTP Stack Component

requires http package - install using mspm install http

module.exports = {
    "extend": ["Component"],
    "methods": {
        init: function () {
            this.getParent().addListener('newRequest', this.handleRequest);
        },
        handleRequest: function (e,req,resp) {
            if (req.url == '/')
                e.next();
            else
                resp.end('forbidden');
        }
    }
};

Read the Component Wiki for learning how to load a component.

Command helpers

Building Server

Inside an empty directory type:

$ mst --new

For others commands, type: mst -h

Installing Package

Inside a monostack server type:

$ mspm install [packageName]

Searching for packages? Try searching for 'monostack package' on NPM.

For others commands, type: mspm -h

Concepts

Community

Cases

License

MIT

npm loves you