Skip to content

Instantly share code, notes, and snippets.

@felipekm
Last active May 25, 2023 16:12
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipekm/43a66cf59fc777f060e29a046c29d710 to your computer and use it in GitHub Desktop.
Save felipekm/43a66cf59fc777f060e29a046c29d710 to your computer and use it in GitHub Desktop.
Use PM2 with RUST

Make a Rust project: cargo init foo

Install PM2:

  1. npm init
  2. npm install pm2

Create a script entry in your package.json to launch pm2:

{
  "scripts": {
    "start": "cargo run",
    "up": "pm2 start target/debug/<your-app> --watch",
    "down": "pm2 stop 0 --watch && pm2 delete 0"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment