config.default.js 1.23 KB
/* 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 + '_1655953567969_2906';
  config.security = {
    csrf: {
      enable: false,
    },
    domainWhiteList: [ '*' ],
  };
  // config.cors = {
  //   origin: '*',
  //   allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS',
  // };

  config.sequelize = {
    dialect: 'mysql', // support: mysql, mariadb, postgres, mssql
    // timezone: '+08:00', // 时区问题
    database: 'track_info',
    host: '192.168.3.210',
    port: 3308,
    username: 'user_frontend',
    password: 'fdfew80w',
    define: {
      underscored: false,
      freezeTableName: true,
      timestamps: false,
    },
  };

  // add your middleware config here
  config.middleware = [];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };
    // ip访问
  config.cluster = {
    listen: {
      // path: '',
      port: 7002,
      hostname: '0.0.0.0',
    },
  };

  return {
    ...config,
    ...userConfig,
  };
};