|
@@ -32,7 +32,6 @@ function Crowi (rootdir, env)
|
|
|
this.config = {};
|
|
this.config = {};
|
|
|
this.mailer = {};
|
|
this.mailer = {};
|
|
|
|
|
|
|
|
- this.events = {};
|
|
|
|
|
|
|
|
|
|
this.models = {};
|
|
this.models = {};
|
|
|
|
|
|
|
@@ -40,6 +39,10 @@ function Crowi (rootdir, env)
|
|
|
this.node_env = this.env.NODE_ENV || 'development';
|
|
this.node_env = this.env.NODE_ENV || 'development';
|
|
|
this.port = this.env.PORT || 3000;
|
|
this.port = this.env.PORT || 3000;
|
|
|
|
|
|
|
|
|
|
+ this.events = {
|
|
|
|
|
+ user: new (require(self.eventsDir + 'user'))(this),
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
if (this.node_env == 'development') {
|
|
if (this.node_env == 'development') {
|
|
|
Promise.longStackTraces();
|
|
Promise.longStackTraces();
|
|
|
}
|
|
}
|
|
@@ -54,12 +57,6 @@ Crowi.prototype.init = function() {
|
|
|
.then(function() {
|
|
.then(function() {
|
|
|
// setup database server and load all modesl
|
|
// setup database server and load all modesl
|
|
|
return self.setupDatabase();
|
|
return self.setupDatabase();
|
|
|
- }).then(function() {
|
|
|
|
|
- // load events
|
|
|
|
|
- self.events = {
|
|
|
|
|
- user: new (require(self.eventsDir + 'user'))(self),
|
|
|
|
|
- };
|
|
|
|
|
- return Promise.resolve();
|
|
|
|
|
}).then(function() {
|
|
}).then(function() {
|
|
|
return self.setupModels();
|
|
return self.setupModels();
|
|
|
}).then(function() {
|
|
}).then(function() {
|