123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- /* eslint valid-jsdoc: "off" */
- 'use strict';
- const { jwt } = require('./config.secret');
- /**
- * @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 + '_1623739063308_1869';
- // add your middleware config here
- config.middleware = [ 'tenantUse' ];
- // add your user config here
- const userConfig = {
- // myAppName: 'egg',
- };
- config.cluster = {
- listen: {
- port: 9901,
- },
- };
- config.appName = 'st'; // 路由的前缀会引用这个变量,组成接口地址
- config.jwt = {
- ...jwt,
- expiresIn: '1d',
- issuer: 'shitang',
- };
- config.dbName = 'shitang';
- config.mongoose = {
- url: `mongodb://localhost:27017/${config.dbName}`,
- options: {
- user: 'admin',
- pass: 'admin',
- authSource: 'admin',
- useNewUrlParser: true,
- useCreateIndex: true,
- },
- };
- config.wxApp = {
- test: {
- appid: 'wxe8b4c4d5e87a7d31',
- secret: '60cffc9d8766e8b169db970d2422a647',
- },
- };
- return {
- ...config,
- ...userConfig,
- };
- };
|