12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- /* 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 = [];
- // 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: '111111',
- // authSource: 'admin',
- // useNewUrlParser: true,
- // useCreateIndex: true,
- },
- };
- config.wx = {};
- return {
- ...config,
- ...userConfig,
- };
- };
|