|
|
@@ -38,6 +38,7 @@ function Crowi(rootdir, env) {
|
|
|
this.interceptorManager = {};
|
|
|
this.passportService = null;
|
|
|
this.globalNotificationService = null;
|
|
|
+ this.restQiitaAPIService = null;
|
|
|
this.xss = new Xss();
|
|
|
|
|
|
this.tokens = null;
|
|
|
@@ -93,6 +94,8 @@ Crowi.prototype.init = function() {
|
|
|
return self.setupCsrf();
|
|
|
}).then(function() {
|
|
|
return self.setUpGlobalNotification();
|
|
|
+ }).then(function() {
|
|
|
+ return self.setUpRestQiitaAPI();
|
|
|
});
|
|
|
};
|
|
|
|
|
|
@@ -253,6 +256,10 @@ Crowi.prototype.getGlobalNotificationService = function() {
|
|
|
return this.globalNotificationService;
|
|
|
};
|
|
|
|
|
|
+Crowi.prototype.getRestQiitaAPIService = function() {
|
|
|
+ return this.restQiitaAPIService;
|
|
|
+};
|
|
|
+
|
|
|
Crowi.prototype.setupPassport = function() {
|
|
|
const config = this.getConfig();
|
|
|
const Config = this.model('Config');
|
|
|
@@ -276,7 +283,7 @@ Crowi.prototype.setupPassport = function() {
|
|
|
this.passportService.setupLdapStrategy();
|
|
|
this.passportService.setupGoogleStrategy();
|
|
|
this.passportService.setupGitHubStrategy();
|
|
|
- this.passportService.setupTwitterStrategy();
|
|
|
+ this.passportService.setupTwitterStrategy();
|
|
|
}
|
|
|
catch (err) {
|
|
|
logger.error(err);
|
|
|
@@ -470,4 +477,14 @@ Crowi.prototype.setUpGlobalNotification = function() {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+/**
|
|
|
+ * setup RestQiitaAPIService
|
|
|
+ */
|
|
|
+Crowi.prototype.setUpRestQiitaAPI = function() {
|
|
|
+ const RestQiitaAPIService = require('../service/rest-qiita-API');
|
|
|
+ if (this.restQiitaAPIService == null) {
|
|
|
+ this.restQiitaAPIService = new RestQiitaAPIService(this);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
module.exports = Crowi;
|