Documentation says:
Instead of starting the app using pm2 start hello.js, you can start Directus using pm2 start npm -- start
pm2 start npm -- start
I have tried
pm2 start npm /home/user/my-app/node_modules/.bin/directus start
Documentation says:
Instead of starting the app using pm2 start hello.js, you can start Directus using pm2 start npm -- start
pm2 start npm -- start
I have tried
pm2 start npm /home/user/my-app/node_modules/.bin/directus start
you can add the start script to your package.json file
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "directus start"
},
Then start it using pm2 start npm -- start
If you need a specific configuration, pm2 start npm --start will not be sufficient. You will need a pm2 configuration file.
ecosystem.config.js file in your directus root directorymodule.exports = {
apps : [
{
name: "directus-app",
script: "npx",
args: "directus start",
restart_delay: 500
}
]
}
The documentation is not wrong and it's that simple if you don't have any other websites or are using virtual hosting with apache or Nginx.
In my case, I'm doing both. I have multiple sites with multiple domains and some of them are using subdomains through the use of virtualhosting.
Here are a few tips if you are in a similar situation:
sudo ufw allow 8055sudo nano /etc/hosts/ and the following line 127.0.0.1 ${{domain here}}I would also recommend reading the pm2 documentation just to get a better understanding of it.