diff --git a/app.js b/app.js index ef403f3..29c53c4 100644 --- a/app.js +++ b/app.js @@ -17,6 +17,13 @@ var hugoJson = null; loadJson(); +fs.watch( config.jsonPath, function( ev, filename ) { + if ( filename ) { + console.log( 'JSON File has been updated and will be reloaded' ); + loadJson(); + } +} ); + function loadJson() { fs.readFile( config.jsonPath, 'utf8', function( err, data ) { if ( err ) {