Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Commit

Permalink
include base controller, service, router into happi
Browse files Browse the repository at this point in the history
  • Loading branch information
vunb committed Dec 9, 2016
1 parent aaccfc4 commit 67746d0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
27 changes: 17 additions & 10 deletions lib/app/Happi.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
var events = require('events');
var controllers = require("./controllers");
var services = require("./services");

function Happi() {
var self = this;
// Inherit methods from EventEmitter
events.EventEmitter.call(this);
var self = this;
// Inherit methods from EventEmitter
events.EventEmitter.call(this);

// Remove memory-leak warning about max listeners
// See:
// http://nodejs.org/docs/latest/api/events.html#events_emitter_setmaxlisteners_n
this.setMaxListeners(0);
// Remove memory-leak warning about max listeners
// See:
// http://nodejs.org/docs/latest/api/events.html#events_emitter_setmaxlisteners_n
this.setMaxListeners(0);

// init default members
this.BaseController = controllers.BaseController;
this.BaseService = services.BaseService;
}

// Extend from EventEmitter to allow hooks to listen to stuff
util.inherits(Happi, events.EventEmitter);


// export happi constructor
module.exports = Happi;
// export happi components
module.exports = Happi;
exports.BaseController = services.BaseController;
exports.BaseService = services.BaseService;
4 changes: 2 additions & 2 deletions lib/app/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var Happi = require("./Happi");
var Happi = require("./happi");

/**
* Create happi factory.
*/
module.exports = function HappiFactory() {
return new Happi();
return new Happi();
}

0 comments on commit 67746d0

Please sign in to comment.