Skip to content

Commit

Permalink
Merge pull request #15 from rsuppersahabatan/master
Browse files Browse the repository at this point in the history
feat: pm2 start
  • Loading branch information
mimamch authored Dec 10, 2024
2 parents 70fced7 + 73ba867 commit 58687be
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ Start the server
npm run start
```

Or Start as Background Process with PM2: Process Manager (For Production) ~ Tested with Ubuntu 20 server

```bash
# example of PATH_PM2 is /www/server/nodejs/v18.13.0/bin/pm2 or you can use pm2 instance
sudo PATH_PM2 start ecosystem.config.js

* FORK or CLUSTER ? -> readmore [here](https://stackoverflow.com/a/36177256)
```

Open On Browser & Start New Session

```bash
Expand Down
14 changes: 14 additions & 0 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
apps : [
{
name : "Start as Background Process with PM2",
script : "./index.js",
instances : "1",
exec_mode : "fork",
env: {
NODE_ENV: "production",
PORT: 3007
}
}
]
}

0 comments on commit 58687be

Please sign in to comment.