console/config/config.default.js

57 lines
1.0 KiB
JavaScript

/* eslint valid-jsdoc: "off" */
'use strict';
const path = require('path');
/**
* @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 + '_1583417062947_4667';
// add your middleware config here
config.middleware = [];
// add your user config here
const userConfig = {
// myAppName: 'egg',
};
config.view = {
root: path.join(appInfo.baseDir, 'app/view'),
mapping: {
'.html': 'nunjucks',
},
};
config.assets = {
publicPath: '/public',
devServer: {
autoPort: true,
command: 'umi dev --port={port}',
env: {
APP_ROOT: path.resolve('app/web'),
BROWSER: 'none',
SOCKET_SERVER: 'http://127.0.0.1:{port}',
},
debug: true,
},
};
config.security = {
csrf: false,
};
return {
...config,
...userConfig,
};
};