mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-01 00:08:53 +02:00
having the loader play nicely with supervisor -- ./nodebb watch can now hit the restart button
This commit is contained in:
11
loader.js
11
loader.js
@@ -1,6 +1,6 @@
|
||||
var fork = require('child_process').fork,
|
||||
start = function() {
|
||||
var nbb = fork('./app', process.argv.slice(2), {
|
||||
nbb = fork('./app', process.argv.slice(2), {
|
||||
env: {
|
||||
'NODE_ENV': process.env.NODE_ENV
|
||||
}
|
||||
@@ -14,6 +14,13 @@ var fork = require('child_process').fork,
|
||||
nbb.kill();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
stop = function() {
|
||||
nbb.kill();
|
||||
},
|
||||
nbb;
|
||||
|
||||
process.on('SIGINT', stop);
|
||||
process.on('SIGTERM', stop);
|
||||
|
||||
start();
|
||||
2
nodebb
2
nodebb
@@ -37,7 +37,7 @@ case "$1" in
|
||||
echo "Launching NodeBB in \"development\" mode."
|
||||
echo "To run the production build of NodeBB, please use \"forever\"."
|
||||
echo "More Information: https://github.com/designcreateplay/NodeBB/wiki/How-to-run-NodeBB"
|
||||
NODE_ENV=development supervisor -q --extensions 'node|js|tpl' -- app "$@"
|
||||
NODE_ENV=development supervisor -q --extensions 'node|js|tpl' -- loader "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
Reference in New Issue
Block a user