This file ( 1kB ) exceeds the allowed full mode (48 kb) size.
The editor full hight is disabled, only scrolling is allowed..
If you wish to edit a file, it is recommended to use the scroll mode as some users do not like the full height
mode, although some users like it.
/*
* grunt-express-server
* https://github.com/ericclemmons/grunt-express-server
*
* Copyright (c) 2013 Eric Clemmons
* Licensed under the MIT license.
*/
'use strict';
var path = require('path');
var server = null; // Store server between live reloads to close/restart express
module.exports = function(grunt) {
grunt.registerTask('express', 'Start an express web server', function() {
var done = this.async();
if (server) {
console.log("Killing existing Express server");
server.kill('SIGTERM');
server = null;
}
server = grunt.util.spawn({
cmd: process.argv[0],
args: [ grunt.config.get(this.name) ],
fallback: function() {
// Prevent EADDRINUSE from breaking Grunt
}
}, function(err, result, code) {
// Nothing to do, but callback has to exist
});
server.stdout.on('data', function() {
if (done) {
done();
}
done = null;
});
server.stdout.pipe(process.stdout);
server.stderr.pipe(process.stdout);
});
};