Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I configure pm2 to run hexo?

Tags:

node.js

pm2

hexo

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.

like image 397
NO WAR WITH RUSSIA Avatar asked Dec 11 '15 08:12

NO WAR WITH RUSSIA


1 Answers

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
like image 119
Ben Fortune Avatar answered Nov 20 '22 15:11

Ben Fortune