Skip to content

Commit 1a66fc1

Browse files
committed
add nodemon watch and restart node process
1 parent 07d292f commit 1a66fc1

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

docker/bin/config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"ignore": [
3+
".git",
4+
"node_modules/**/node_modules"
5+
],
6+
"execMap": {
7+
"js": "node --debug --harmony"
8+
},
9+
"verbose": true,
10+
"TODO":"https://github.com/remy/nodemon/issues/951",
11+
"watch": [
12+
"./"
13+
]
14+
}

docker/bin/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Created by Freax on 16-12-11.
3+
* @Blog http://www.myfreax.com/
4+
*/
5+
const nodemon = require('nodemon');
6+
const config = require('./config.json');
7+
8+
nodemon(config);
9+
10+
11+
12+
nodemon.on('start', function () {
13+
console.log('App has started');
14+
}).on('quit', function () {
15+
console.log('App has quit');
16+
}).on('restart', function (files) {
17+
console.log('App restarted due to: ', files);
18+
});

0 commit comments

Comments
 (0)