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
- AnExpress
instance. - databases:
Object
- App databases. - childs:
Object
- AppBubble
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 ofBubble
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 attribute | Type | Description |
---|---|---|
config.domain |
String |
Sets app domain |
config.http.port |
Number |
Sets app http port |
config.https.port |
Number |
Sets app https port |
Methods
- enableLogging( logger (optional):
Function
) - Enable logging usinglogger
if passed. - run( fn:
Function
) - Execute and inject dependencies tofn
. - 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
- parentBubble
instance.
Example
var Bubble = ; var bubble = domain: 'localhost:3000' http: port: 3000 https: port: 5000 ; bubble; bubble;