$ npm install
$ npm run dev
$ open http://localhost:7001/news
Use EGG_SERVER_ENV=prod
to enable prod mode
$ EGG_SERVER_ENV=prod npm start
- Use
npm run lint
to check code style. - Use
npm test
to run unit test. - Use
npm run autod
to auto detect dependencies upgrade, see autod for more detail.
##部署:
$ npm install --production $ tar -zcvf ../release.tgz .
tar -xzvf release.tgz -C xxx
打包传到服务器
现网发布
$ EGG_SERVER_ENV=prod npm start
云测发布
$ EGG_SERVER_ENV=test npm start
日志级别 修改以下代码,云测修改config.test.js 修改以下代码,生产环境修改config.prod.js
config.logger = {
dir: '/data/logs/egg_access',
level: 'INFO',
consoleLevel: 'INFO'
};