Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加pm2文件变化重启 #131

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
apps : [{
name: "gd-utils",
script: "./server.js",
exec_mode: "fork",
watch: "true",
ignore_watch: ["gdurl.sqlite", "node_modules", "backup", "sa/invalid"],
env: {
NODE_ENV: "development",
},
env_production: {
NODE_ENV: "production",
}
}]
}
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ tg_whitelist: ['viegg', '其他人的username'],

如果你之前是在本地操作的,请在服务器上同样重复一遍,配置好相关参数后,执行`npm i pm2 -g`安装进程守护程序pm2

安装好pm2之后,执行 `pm2 start server.js --node-args="--max-old-space-size=1024"`,代码运行后会在服务器上监听`23333`端口。
安装好pm2之后,执行 `pm2 start server.js --node-args="--max-old-space-size=1024" --watch`,代码运行后会在服务器上监听`23333`端口。

如果你启动程序后想看运行日志,执行 `pm2 logs`

Expand Down