const path = require('path')

const resolve = filePath => path.resolve(__dirname, filePath)

const ports = {
  appPort: 5555,
  wsPort: 5556
}

const routerOptions = {
  prefix: '/api'
}
const lruOptions = {
  max: 50, // 最多缓存50个
  maxAge: 1000 * 60 * 60 * 1 // 缓存1小时
}
const watchFileOptions = {
  interval: 60 * 10e2 // 轮询时间间隔
}
const dataPath = resolve('./data/data.txt')
const reviewDataPath = resolve('./data/reviewData.txt')

// 转换成绝对路径会出现访问 404
const staticPath = '../dist'
const filePath = {
  dataPath,
  reviewDataPath,
  staticPath
}

const config = {
  ports,
  routerOptions,
  lruOptions,
  watchFileOptions,
  filePath
}

module.exports = config