0.1.7 • Published 7 years ago

uon.app v0.1.7

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

UON APP Framework

Usage

npm install uon.app --save
const Application = require('uon.app');


// instanciate an Application with options
const my_app = new Application({

	// will launch one process on each physical core
	cluster: true, 
});


// start the app with a list of bundles to init
my_app.start({
	
	// Load a bundle by name
	'mybundle' : {
		services : {
			'MyService' : {
				option1 : 1234
			}
		}
	},
	
	'my_preloaded_bundle' : {
		bundle : require('./InProjectBundle')
	}

});

To define a bundle you can use :

const Bundle = require('uon.app').Bundle;

const MyBundle = new Bundle(['MyOtherModule1', 'MyOtherModule2']);

MyBundle.service('MyService', ['OtherService', (options, OtherService) => {
	// service implementation
	...
}]);

module.exports = MyBundle;

In package.json you must specify where the bundle is located

{
	...
	"bundle" : "./bundle.js"
	...
}

TODOs

  • Finish this README
  • More documentation and comments
0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

8 years ago