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.
How do I configure pm2 to run hexo?
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
@AbnerChou Well it won't, it's a bash script. –
Lamson
I have turned it to the batch script. The pm2 task fails. –
Godavari
@AbnerChou For me, I need to add
cd "$(dirname "$0")"
before hexo server
to make it work. –
Cellobiose I think you can try with:
pm2 start app.js -- server -s
Where app.js is a simple file containing this:
require('hexo-cli');
© 2022 - 2024 — McMap. All rights reserved.