feat: 添加应用配置文件,设置环境变量和日志路径
This commit is contained in:
parent
bddd42a6c0
commit
4d1e218437
|
|
@ -0,0 +1,16 @@
|
|||
module.exports = {
|
||||
apps: [{
|
||||
name: 'my-agent', // 应用名称
|
||||
script: './dist/index.js', // 应用入口文件
|
||||
autorestart: true, // 崩溃后自动重启[citation:2]
|
||||
max_memory_restart: '1G', // 内存超过1G自动重启[citation:2]
|
||||
env: {
|
||||
NODE_ENV: 'production', // 默认环境变量(开发)
|
||||
PORT: 7328
|
||||
},
|
||||
// 日志配置
|
||||
error_file: './logs/err.log', // 错误日志路径
|
||||
out_file: './logs/out.log', // 输出日志路径
|
||||
log_date_format: 'YYYY-MM-DD HH:mm:ss' // 日志时间格式
|
||||
}]
|
||||
};
|
||||
Loading…
Reference in New Issue