This repository has been archived by the owner on Jul 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
include base controller, service, router into happi
- Loading branch information
Showing
2 changed files
with
19 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |