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

Fix pm2 #225

Merged
merged 2 commits into from
Sep 26, 2024
Merged
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
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,11 @@ $ pnpm start

If you are self-hosting or your process manager does not automatically restart the bot in the event of a crash, you may use [PM2](https://pm2.keymetrics.io/), a process manager for Node.js applications.

1. Install PM2.
Use the `pm2:start` script instead of the `start` script to launch the bot. To stop the process, use the `pm2:kill` script.

```bash
$ pnpm add pm2
```

2. Use the `pm2` script instead of the `start` script to launch the bot.

```bash
$ pnpm run pm2
$ pnpm run pm2:start
$ pnpm run pm2:kill
```

Please refer to the [PM2 Documentation](https://pm2.keymetrics.io/docs/usage/quick-start/) for more configuration options and information about PM2.
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"license": "MIT",
"private": false,
"scripts": {
"build": "tsc && tsc-alias",
"build": "tsc --build --clean && tsc-alias",
"clean": "rm -r dist/",
"dev": "ts-node-dev --respawn --transpile-only --poll -r tsconfig-paths/register src/index.ts",
"format": "prettier --write .",
"lint": "prettier --check . && eslint .",
"pm2": "pm2 logs && pm2 start dist/index.js --name bridge",
"pm2:kill": "pm2 kill",
"pm2:start": "pm2 start dist/index.js --attach --name bridge",
"setup-files": "node scripts/setup-files.js",
"start": "node ."
},
Expand All @@ -21,6 +21,7 @@
"dotenv": "^16.4.5",
"mineflayer": "^4.20.1",
"obscenity": "^0.1.4",
"pm2": "^5.4.2",
"prismarine-chat": "^1.10.1",
"zod": "^3.23.8"
},
Expand Down
Loading