12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- 'use strict';
- const path = require('path');
- module.exports = appInfo => {
- const config = exports = {};
- // use for cookie sign key, should change to your own and keep security
- config.keys = appInfo.name + '_smartcost3850888';
- // 数据库配置
- config.mysql = {
- client: {
- // host
- host: '127.0.0.1',
- // 端口号
- port: '3306',
- // 用户名
- user: 'zongheng',
- // 密码
- password: '@)!(smartcost#*%)',
- // 数据库名
- database: 'index_sys',
- },
- // 是否加载到 app 上,默认开启
- app: true,
- // 是否加载到 agent 上,默认关闭
- agent: false,
- };
- // view
- config.view = {
- mapping: {
- '.ejs': 'ejs',
- },
- root: [
- path.join(appInfo.baseDir, 'app/view'),
- ].join(','),
- };
- // session
- config.session = {
- key: 'ZHC_SESS',
- maxAge: 3600 * 1000,
- httpOnly: true,
- encrypt: true,
- };
- // 表名前缀
- config.tablePrefix = 'is_';
- // add your config here
- config.middleware = ['urlParse'];
- // 上传设置
- config.multipart = {
- whitelist: ['.xls', '.xlsx', '.json'],
- fileSize: '10mb',
- };
- //web-socket
- config.io = {
- init: {},
- namespace: {
- '/': {
- connectionMiddleware: [],
- packetMiddleware: [],
- },
- '/lib': {
- connectionMiddleware: [],
- packetMiddleware: [],
- }
- },
- redis: {
- // host
- host: '127.0.0.1',
- // 端口号
- port: '6379',
- // 用户名
- auth_pass: 'smart#*%)cost888',
- // 密码
- db: '8',
- }
- };
- // 是否压缩替换前端js
- config.min = true;
- return config;
- };
|