FIX grunt bug

This commit is contained in:
unpregnant 2017-02-22 22:59:22 +01:00
parent 2a30bc3c5e
commit ac00b62107
3 changed files with 13 additions and 2 deletions

View File

@ -44,7 +44,7 @@ module.exports = function(grunt) {
'resumes/**/*.less',
'less/**/*.less'
],
tasks: ['execute', 'babel', 'bgShell:express'],
tasks: ['execute', 'babel', 'bgShell:express', 'execute:wait'],
options: {
nospawn: false,
livereload: true

View File

@ -17,7 +17,7 @@ process.argv.forEach(argument => {
Server.kill();
break;
case 'wait':
setTimeout(() => console.log('waiting'), 5000);
setTimeout(() => console.log('waiting'), 3000);
break;
}
});

View File

@ -5,6 +5,9 @@ const Config = require('./Config');
const Util = require('./Util');
const person = require('../person.js');
const http = require('http');
const reload = require('reload');
let app, resumes;
const Server = {
/**
@ -60,6 +63,13 @@ const Server = {
app.get('/kill', () => process.exit());
},
/**
* does autorealod
*/
autoReload: function() {
const server = http.createServer(app);
reload(server, app);
},
/**
* sets routes for each resume
*/
@ -81,6 +91,7 @@ const Server = {
Server.setKillRoute();
Server.kill();
await Util.setTimeout(500);
Server.autoReload();
Server.start();
}
};