Skip to content

Instantly share code, notes, and snippets.

@felipekm
Last active July 23, 2024 12:09
Show Gist options
  • 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