ericclemmons / grunt-express-server

Grunt task for running an Express Server that works great with LiveReload + Watch/Regarde

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Help setting with watch

Danilux opened this issue · comments

Hi, I'm just giving my first steps with grunt, and I have been trying to set express-server along with watch to run my simple index.html with no success, my current watch configuration is :

   watch: {

        options: {
            livereload: true,
        },

        scripts: {
            files: ['js/*.js'],
            tasks: ['concat', 'uglify'],
            options: {
                spawn: false,
              },
            },

      css: {
        files: '**/*.scss',
        tasks: ['compass']
      },
      html: {
        files: ['index.html'],
        tasks: ['htmlhint']
      }

  }

In the readme.md watch example you run a tasks for a dev sever that's pointing to "server.js" is that a node server I have to create? Any help as you may see is appreciated.

Yeah. grunt-express-server starts a node instance with a given .js file as a parameter and is able to restart when necessary.
So you should create a server.js where you start an express server which serves the correct files.