123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- '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 = {});
- config.keys = appInfo.name + '_1640765284662_2781';
- config.appName = '项目模板-服务';
- config.middleware = [ 'requestLog' ];
- // 日志
- config.logger = {
- level: 'DEBUG',
- allowDebugAtProd: true,
- };
- // http请求前缀
- config.httpPrefix = {
- logs: 'http://localhost:10001/projectadmin/api',
- };
- // 进程设置
- config.cluster = {
- listen: {
- port: 10002,
- },
- };
- // jwt设置
- config.jwt = {
- ...jwt,
- expiresIn: '1d',
- issuer: 'projectadmin',
- };
- // 数据库设置
- config.dbName = 'projectadmin';
- config.mongoose = {
- url: `mongodb://localhost:27017/${config.dbName}`,
- options: {
- user: 'admin',
- pass: 'admin',
- authSource: 'admin',
- useNewUrlParser: true,
- useCreateIndex: true,
- },
- };
- // 路由设置
- config.routePrefix = '/projectadmin/api';
- // 中间件
- config.requestLog = {
- toMongoDB: true,
- };
- config.module = 'user';
- return {
- ...config,
- };
- };
|