Question

Here is my Gruntfile.js.

module.exports = function(grunt) {

  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

  grunt.initConfig({
    dirs: {
      js: ['app/js/**/*.js', '!app/js/libs/**/*.js'],
      jshint: ['Gruntfile.js','app/js/**/*.js','!app/js/libs/**/*.js'],
      html: ['app/index.html'],
      css: ['app/styles/**/*.css'],
      less: ['app/styles/**/*.less'],
      tests: ['test/**/*.js']
    },
    hbs: {
      templateExtension : 'hbs'
    },
    connect:{
      development: {
        port: 9000,
        base: 'app',
        keepalive: true,
        livereload: true
      }
    }
  });

  grunt.registerTask('server', ['less', 'connect', 'watch', 'open:dev']);
};

When I start the server, it runs on port 8000. From how I understand it I am specifying the port in the connect:developement:port property. What would make it run on port 8000? enter image description here

Was it helpful?

Solution

try changing the connect postfix to development:

grunt.registerTask('server', ['less', 'connect:development', 'watch', 'open:dev']);

you might need to specify the options too:

connect: {
    development: {
        options: {
            port: 9000,
            base: 'app',
            keepalive: true,
            livereload: true
        }
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top