title: Getting grunt-express to restart on changes
body: <p>I'm trying to use grunt-express and grunt-watch. I would like the server to reload with I change my server file. </p>
  
  <p>Here is what I got.</p>
  
  <p>Gruntfile.js</p>
  
  <pre><code>var path = require('path');
  module.exports = function(grunt) {
    grunt.initConfig({
      express: {
        options: {
          port: 8000
        },
        load: {
          server: path.resolve('./app')
        }
      },
      watch: {
        express: {
          files: ['app.js'],
          tasks: ['express:load']
  
        }
      }
    });
    grunt.loadNpmTasks('grunt-karma');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-express');
  
    grunt.registerTask('server', ['express:load', 'express-keepalive', 'watch']);
  };
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>var express = require('express');
  var app = express();
  var server = require('http').createServer(app);
  
  app.get('/', function(req, res) {
    res.sendfile(__dirname + '/public/index.html');
  });
  exports = module.exports = server;
  exports.use = function() {
    app.use.apply(app, arguments);
  };
  </code></pre>
  
  <p>When I type grunt server in the console I get: </p>
  
  <pre><code>Running "express:load" (express) task
  
  Running "express-server:load" (express-server) task
  Web server started on port:8000, no hostname specified [pid: 21115]
  
  Running "express-keepalive" task
  </code></pre>
  
  <p>The server start up fine and I can go to localhost:8000 to view my page. The watch task doesn't seem to start and when I make changes to app.js it doesn't restart. I basically want type grunt server and then when any changes happen to app.js, I want the server to restart. I've tried using the serverreload option, but I can't seem to get that to work either. I have also tried using express-restart (in place of express:livereload) in the watch:express task, but it says</p>
  
  <pre><code>Warning: path must be a string Use --force to continue.
  </code></pre>