123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- /* eslint valid-jsdoc: "off" */
- 'use strict';
- /**
- * @param {Egg.EggAppInfo} appInfo app info
- */
- module.exports = appInfo => {
- /**
- * built-in config
- * @type {Egg.EggAppConfig}
- **/
- const config = exports = {};
- // use for cookie sign key, should change to your own and keep security
- config.keys = appInfo.name + '_1576464120622_7058';
- // post form请求 关闭csrf安全插件
- config.security = {
- csrf: {
- enable: false,
- ignoreJSON: true,
- },
- // domainWhiteList: [ 'http://www.baidu.com' ], // 配置白名单
- };
- config.cluster = {
- listen: {
- port: 7001,
- },
- };
- // add your middleware config here
- config.middleware = [ 'errorHandler' ];
- // add your user config here
- const userConfig = {
- // myAppName: 'egg',
- cors: {
- origin: '*', // 注释掉就是上面的white生效
- allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH',
- },
- GDKEY: '61fa7b06efe476b14bfd7cda375d90ff',
- GDAPI: 'https://restapi.amap.com/v3/geocode/regeo',
- isDevData: true,
- };
- const fixGroupAgg = require('../app/util/fixGroupAgg');
- config.mongoose = {
- // url: 'mongodb://账号:密码@服务器:端口/库名',
- url: process.env.EGG_MONGODB_URL || 'mongodb://127.0.0.1/faw-etl-local',
- options: {
- server: {
- poolSize: 40,
- },
- },
- clients: {
- etlDB: { // 原始数据库
- url: 'mongodb://127.0.0.1/faw-etl', //
- // url: 'mongodb://faw-etl-readonly:faw-etl-readonly@10.6.222.37:27017/faw-etl',//dev
- // url: 'mongodb://faw-etl-admin:faw-etl-admin%40123@10.112.16.11:27017/faw-etl', // sit
- // url: 'mongodb://faw-etl:faw-etl123@uat.dbaas.private:27028/faw-etl', // uat
- options: {
- useUnifiedTopology: true,
- poolSize: 40,
- },
- },
- etlLocalDB: { // 本地清洗后的数据库
- url: 'mongodb://127.0.0.1/faw-etl-local', //
- // url: 'mongodb://faw-etl-local:faw-etl-local%40123@10.6.222.37:27017/faw-etl-local', // dev
- // url: 'mongodb://faw-etl-local:faw-etl-local%40123@10.112.16.11:27017/faw-etl-local', // sit
- // url: 'mongodb://local3:local3%40123@uat.dbaas.private:27028/faw-etl-local3', // uat
- options: {
- useUnifiedTopology: true,
- poolSize: 40,
- },
- },
- },
- plugins: [ fixGroupAgg ],
- };
- config.validate = { // 配置参数校验器,基于parameter
- convert: true, // 对参数可以使用convertType规则进行类型转换
- // validateRoot: false, // 限制被验证值必须是一个对象。
- };
- config.redis = {
- };
- return {
- ...config,
- ...userConfig,
- };
- };
|