6

I've used pm2 in the past for my express apps. I really like it. How do I get it to run hexo. Hexo starts with hexo server rather than with a js entry point.

Evan Carroll
  • 78,363
  • 46
  • 261
  • 468

2 Answers2

4

If you're running Linux or OSX, you can start it with a bash script.

Create a file called hexo.sh with the following

#!/usr/bin/env bash
hexo server

Then just simply

pm2 start hexo.sh
Ben Fortune
  • 31,623
  • 10
  • 79
  • 80
0

I think you can try with:

pm2 start app.js -- server -s

Where app.js is a simple file containing this:

require('hexo-cli');
michelem
  • 14,430
  • 5
  • 50
  • 66