|
|
@@ -28,6 +28,7 @@ function Crowi (rootdir, env)
|
|
|
this.mailDir = path.join(this.viewsDir, 'mail') + sep;
|
|
|
|
|
|
this.config = {};
|
|
|
+ this.searcher = {};
|
|
|
this.mailer = {};
|
|
|
|
|
|
|
|
|
@@ -73,6 +74,8 @@ Crowi.prototype.init = function() {
|
|
|
return resolve();
|
|
|
});
|
|
|
});
|
|
|
+ }).then(function() {
|
|
|
+ return self.setupSearcher();
|
|
|
}).then(function() {
|
|
|
return self.setupMailer();
|
|
|
});
|
|
|
@@ -182,10 +185,28 @@ Crowi.prototype.getIo = function() {
|
|
|
return this.io;
|
|
|
};
|
|
|
|
|
|
+Crowi.prototype.getSearcher = function() {
|
|
|
+ return this.searcher;
|
|
|
+};
|
|
|
+
|
|
|
Crowi.prototype.getMailer = function() {
|
|
|
return this.mailer;
|
|
|
};
|
|
|
|
|
|
+Crowi.prototype.setupSearcher = function() {
|
|
|
+ var self = this;
|
|
|
+ var searcherUri = this.env.ELASTICSEARCH_URI
|
|
|
+ || null
|
|
|
+ ;
|
|
|
+
|
|
|
+ return new Promise(function(resolve, reject) {
|
|
|
+ if (searcherUri) {
|
|
|
+ self.searcher = require('../util/searcher')(self);
|
|
|
+ }
|
|
|
+ resolve();
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
Crowi.prototype.setupMailer = function() {
|
|
|
var self = this;
|
|
|
return new Promise(function(resolve, reject) {
|