<commit_before>// Use the gulp-help plugin which defines a default gulp task
// which lists what tasks are available.
var gulp = require('gulp-help')(require('gulp'));

var server = require( 'gulp-develop-server' );

var packagejson = require('../package.json');

gulp.task('server:start', 'Start serving the app', function(done) {
  var binaryPath = packagejson.bin['module-name'];
  server.listen({
    path: binaryPath,
    env: {
      NODE_ENV: 'development',
      PORT: 1337
    }
  }, done);
});

gulp.task('server:stop', 'Stop serving the app', function(done) {
  server.kill(undefined, done);
});<commit_msg>Add support for development server restart on file change.<commit_after>// Use the gulp-help plugin which defines a default gulp task
// which lists what tasks are available.
var gulp = require('gulp-help')(require('gulp'));

// https://github.com/narirou/gulp-develop-server
// Relies on default or defineable signals from the child
// server process to detect start success and error
// http://stackoverflow.com/a/10394457
var server = require('gulp-develop-server');

var packagejson = require('../package.json');
var binaryPath = packagejson.bin['module-name'];
var watchGlobs = [
  binaryPath,
  'app.js',
  'lib/**/*.js',
  'public/css/**/*.css',
  'public/javascript/**/*.js',
  'routes/**/*.js',
  'views/**/*'
];

gulp.task('server:start', 'Start serving the app', function(done) {

  server.listen({
    path: binaryPath,
    env: {
      NODE_ENV: 'development',
      PORT: 1337
    }
  }, done);
});

gulp.task('server:stop', 'Stop serving the app', function(done) {
  server.kill(undefined, done);
});

// Note: will exit process on error.
gulp.task('server:restart', 'Restart the server when defined files change', function() {
    gulp.watch(watchGlobs, server.restart);
});
{'fraction_non_alphanumeric': 0.1670353982300885, 'fraction_numerical': 0.008849557522123894, 'mean_word_length': 3.96978021978022, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '470381', 'n_tokens_mistral': 584, 'n_tokens_neox': 568, 'n_words': 158}