/* eslint valid-jsdoc: "off" */ 'use strict'; /** * @param {Egg.EggAppInfo} appInfo app info */ const { jwt } = require('./config.secret'); 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 + '_1664237342649_2194'; // add your middleware config here config.middleware = []; // add your user config here const userConfig = { // myAppName: 'egg', }; config.checkToken = { enable: false, }; // 进程设置 config.cluster = { listen: { port: 12111, }, }; // 数据库设置 config.dbName = 'point_shopping'; config.mongoose = { url: `mongodb://120.48.146.1:27017/${config.dbName}`, // 120.48.146.1 127.0.0.1 options: { user: 'admin', pass: 'admin', authSource: 'admin', useNewUrlParser: true, useCreateIndex: true, }, }; // jwt设置 config.jwt = { ...jwt, expiresIn: '1d', issuer: 'shopping', }; // redis设置 config.redis = { client: { port: 6379, // Redis port host: '127.0.0.1', // Redis host password: '123456', db: 1, }, }; // 路由设置 config.routePrefix = '/point/v1/api'; // 中间件 config.requestLog = { toMongoDB: true, }; return { ...config, ...userConfig, }; };