How to configure pm2 to run hexo?

I have used pm2 in the past for my express applications. I really like it. How do I run it hexo . Hexo starts with a hexo server , not a js entry point.

+5
source share
2 answers

If you are using Linux or OSX, you can run it using a bash script.

Create a file called hexo.sh with the following

 #!/usr/bin/env bash hexo server 

Then just plain

 pm2 start hexo.sh 
+3
source

I think you can try:

 pm2 start app.js -- server -s 

Where app.js is a simple file containing this:

 require('hexo-cli'); 
0
source

Source: https://habr.com/ru/post/1237912/


All Articles