Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | 3x 3x 3x 3x 3x 3x 3x | 'use strict'
const path = require('path')
const _ = require('lodash')
const fs = require('fs')
let all = {
appName: 'horse',
ip: process.env.IP || '0.0.0.0',
port: process.env.PORT || 8787,
env: process.env.NODE_ENV || 'development',
baseApi: '/api',
root: path.normalize(__dirname + '/../../../..'),
// mongodb
mongo: {
options: {
useMongoClient: true,
reconnectTries: Number.MAX_VALUE, // Never stop trying to reconnect
reconnectInterval: 500, // Reconnect every 500ms
poolSize: 10, // Maintain up to 10 socket connections
bufferMaxEntries: 0, // If not connected, return errors immediately rather than waiting for reconnect
},
},
// redis
redis: {
host: process.env.REDIS_HOST || 'localhost', // 127.0.0.1
port: process.env.REDIS_PORT || 6379,
db: 10,
},
redisSession: {
host: process.env.REDIS_HOST || 'localhost',
port: process.env.REDIS_PORT || 6379,
auth_pass: process.env.REDIS_PWD || '',
db: 11,
},
cookie: {
key: ['horse-key', 'koa-key'],
},
session: {
key: 'horse-key.sid',
secret: 'horse-secret',
cookie: {
// domain:'.2ite.com',环境处理
maxAge: 60 * 60 * 24 * 30 * 1000, // cookie和jwt共用,但单位不一样;30d
},
},
seedDB: process.env.INITDATA || false,
}
let config = _.merge(all, require('./' + all.env + '.js') || {}, require('./shared'))
Iif (fs.existsSync(path.join(__dirname, 'private/index.js'))) {
config = _.merge(config, require(path.join(__dirname, 'private/index.js')) || {})
}
module.exports = config |