hexo-admin 常驻后台
Laiyong Wang Lv5

原文链接:https://www.cnblogs.com/young233/p/14628456.html

安装 hexo-admin

1
2
//博客跟目录执行
npm install --save hexo-admin

安装pm2

1
npm install -g pm2

进到博客的根目录,新建一个文件:hexo_run.js

1
2
3
4
5
6
7
8
9
10
//run
const { exec } = require('child_process')
exec('hexo server',(error, stdout, stderr) => {
if(error){
console.log('exec error: ${error}')
return
}
console.log('stdout: ${stdout}');
console.log('stderr: ${stderr}');
})

启动这个进程服务

1
pm2 start hexo_run.js
 Comments