Просмотр исходного кода

move interceptor-manager to src/lib/service

Yuki Takei 7 лет назад
Родитель
Сommit
2c95e9e56a

+ 1 - 1
src/client/js/components/PageEditor/CodeMirrorEditor.js

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
 
 import Modal from 'react-bootstrap/es/Modal';
 
-import InterceptorManager from '@server/util/interceptor-manager';
+import InterceptorManager from '@commons/service/interceptor-manager';
 
 import urljoin from 'url-join';
 const loadScript = require('simple-load-script');

+ 1 - 1
src/client/js/components/PageEditor/TextAreaEditor.js

@@ -3,7 +3,7 @@ import React from 'react';
 
 import FormControl from 'react-bootstrap/es/FormControl';
 
-import InterceptorManager from '@server/util/interceptor-manager';
+import InterceptorManager from '@commons/service/interceptor-manager';
 
 import AbstractEditor from './AbstractEditor';
 

+ 1 - 1
src/client/js/util/Crowi.js

@@ -4,7 +4,7 @@
 
 import axios from 'axios';
 
-import InterceptorManager from '@server/util/interceptor-manager';
+import InterceptorManager from '@commons/service/interceptor-manager';
 
 import emojiStrategy from './emojione/emoji_strategy_shrinked.json';
 

+ 0 - 0
src/server/util/interceptor-manager.js → src/lib/service/interceptor-manager.js


+ 3 - 12
src/server/crowi/index.js

@@ -4,6 +4,7 @@
 const debug = require('debug')('growi:crowi')
   , logger = require('@alias/logger')('growi:crowi')
   , pkg = require('@root/package.json')
+  , InterceptorManager = require('@commons/service/interceptor-manager')
   , Xss = require('@commons/service/xss')
   , path = require('path')
   , sep = path.sep
@@ -35,9 +36,10 @@ function Crowi(rootdir, env) {
   this.config = {};
   this.searcher = null;
   this.mailer = {};
-  this.interceptorManager = {};
   this.passportService = null;
   this.globalNotificationService = null;
+
+  this.interceptorManager = new InterceptorManager();
   this.xss = new Xss();
 
   this.tokens = null;
@@ -85,8 +87,6 @@ Crowi.prototype.init = function() {
       return self.setupSearcher();
     }).then(function() {
       return self.setupMailer();
-    }).then(function() {
-      return self.setupInterceptorManager();
     }).then(function() {
       return self.setupSlack();
     }).then(function() {
@@ -313,15 +313,6 @@ Crowi.prototype.setupMailer = function() {
   });
 };
 
-Crowi.prototype.setupInterceptorManager = function() {
-  var self = this;
-  return new Promise(function(resolve, reject) {
-    const InterceptorManager = require('../util/interceptor-manager');
-    self.interceptorManager = new InterceptorManager();
-    resolve();
-  });
-};
-
 Crowi.prototype.setupSlack = function() {
   var self = this;
   var config = this.getConfig();