Selaa lähdekoodia

remove config

wallace5303 3 vuotta sitten
vanhempi
commit
309d4fc5f2
5 muutettua tiedostoa jossa 0 lisäystä ja 136 poistoa
  1. 0 89
      config/config.default.js
  2. 0 13
      config/config.local.js
  3. 0 14
      config/config.prod.js
  4. 0 10
      config/plugin.js
  5. 0 10
      main.js

+ 0 - 89
config/config.default.js

@@ -1,89 +0,0 @@
-'use strict';
-
-const path = require('path');
-const Utils = require('ee-core').Utils;
-const eggConfig = Utils.getEggConfig();
-
-/**
- * @param {Egg.EggAppInfo} appInfo app info
- */
-module.exports = appInfo => {
-  /**
-   * built-in config
-   * @type {Egg.EggAppConfig}
-   **/
-  const config = {};
-
-  // use for cookie sign key, should change to your own and keep security
-  config.keys = appInfo.name + '_1552879336505_7432';
-
-  // add your middleware config here
-  config.middleware = [];
-
-  // add your user config here
-  const userConfig = {};
-
-  config.cluster = {
-    listen: {
-      port: eggConfig.port || 7068,
-      hostname: eggConfig.hostname || '127.0.0.1',
-    },
-  };
-
-  /* 跨域插件配置-start */
-  config.security = {
-    xframe: {
-      enable: false,
-    },
-    ignore: '/api',
-    // 跨域允许的域名列表-配置
-    domainWhiteList: [
-      '*',
-      // 'http://127.0.0.1:8080'
-    ],
-    methodnoallow: { enable: false },
-    // 安全配置
-    csrf: {
-      enable: false,
-      ignoreJSON: true, // 默认为 false,当设置为 true 时,将会放过所有 content-type 为 `application/json` 的请求
-    },
-  };
-  // 允许的跨域请求类型(GET,POST)
-  config.cors = {
-    origin: '*',
-    allowMethods: 'GET,POST,HEAD,PUT,OPTIONS,DELETE,PATCH',
-  };
-  /* 跨域插件配置-end */
-
-  // 获取真实ip
-  config.maxProxyCount = 2;
-  
-  config.view = {
-    root: [path.join(appInfo.baseDir, 'app/view')].join(','),
-    mapping: {
-      '.ejs': 'ejs',
-    },
-  };
-
-  config.static = {
-    // 静态化访问前缀,如:`http://127.0.0.1:7001/static/images/logo.png`
-    prefix: '/', 
-    dir: [path.join(appInfo.baseDir, 'app/public')], // `String` or `Array:[dir1, dir2, ...]` 静态化目录,可以设置多个静态化目录
-    dynamic: true, // 如果当前访问的静态资源没有缓存,则缓存静态文件,和`preload`配合使用;
-    preload: false,
-    maxAge: 31536000, // in prod env, 0 in other envs
-    buffer: true, // in prod env, false in other envs
-  };
-
-  config.ejs = {};
-
-  config.multipart = {
-    mode: 'file',
-    fileExtensions: [ '.xlsx', '.crx' ] // 增加你需要的文件扩展名
-  };
-
-  return {
-    ...config,
-    ...userConfig,
-  };
-};

+ 0 - 13
config/config.local.js

@@ -1,13 +0,0 @@
-'use strict';
-
-const Utils = require('ee-core').Utils;
-const logDir = Utils.getLogDir();
-
-/*
- * 日志dir目录,会随开发环境变动,请谨慎修改
- */
-exports.logger = {
-  dir: logDir,
-};
-
-

+ 0 - 14
config/config.prod.js

@@ -1,14 +0,0 @@
-'use strict';
-
-const Utils = require('ee-core').Utils;
-const logDir = Utils.getLogDir();
-
-/*
- * 日志dir目录,会随开发环境变动,请谨慎修改
- */
-exports.logger = {
-  dir: logDir,
-};
-
-
-

+ 0 - 10
config/plugin.js

@@ -1,10 +0,0 @@
-'use strict';
-
-/*
- *Egg插件
- */
-
-exports.ejs = {
-  enable: true,
-  package: 'egg-view-ejs',
-};

+ 0 - 10
main.js

@@ -21,16 +21,6 @@ class Main extends Appliaction {
 
   }
 
-  startEggCluster (options) {
-    return new Promise((resolve, reject) => {
-      this.coreLogger.info('[ee-core:EeApp] [startEggCluster] op', options);
-      const startCluster = require('egg-cluster').startCluster;
-      startCluster(options, function(){
-        resolve('success');
-      });
-    });
-  }
-
   /**
    * before app close
    */