2.2.0 • Published 8 years ago

express-bubble v2.2.0

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

Bubble

An express framework wrapper

Installation

npm install express-bubble --save

Attributtes

  • logger: Function - (optional) A function used to log in console.
  • config: Object - An object with app configuration.
  • app: express - An Express instance.
  • databases: Object - App databases.
  • childs: Object - App Bubble childs.
  • interfaces: Object - App interfaces.
  • agents: Object - App agents.
  • transporters: Object - App transporters.
  • controllers: Object - App controllers.

Constructor

  • new Bubble(config: Object, parentBubble (optional): Bubble ) - Creates a new instance of Bubble getting config with app configuration and an optional parameter parentBubble with an instance of the parent bubble if is the child bubble.

Config parameter attributes

Config attributeTypeDescription
config.domainStringSets app domain
config.http.portNumberSets app http port
config.https.portNumberSets app https port

Methods

  • enableLogging( logger (optional): Function ) - Enable logging using logger if passed.
  • run( fn: Function ) - Execute and inject dependencies to fn.
  • install( name: String, bubble: Bubble ) - Append bubble app.
  • up() - Start serving (only available if current app is root).

Available dependencies

  • $app - express instance.
  • $config- App configuration.
  • $databases - App databases.
  • $libs - External modules.
  • $logger - Logger function.
  • $express - express framework.
  • $interfaces - App interfaces.
  • $agents - App agents.
  • $transporters - App transporters.
  • $controllers - App controllers.
  • $q - Q promises library.
  • $parent - parent Bubble instance.

Example

var Bubble = require('express-bubble');

var bubble = new Bubble({
	domain: 'localhost:3000',
	http: { port: 3000 },
	https: { port: 5000 }
});

bubble.run(function ($app) {
	$app.get(req, res, next) {
		res.send('Hello World!');
		res.end();
	}
});

bubble.up();

Other examples

2.2.0

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.4

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.0

8 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.0

8 years ago