blai / grunt-express

Start an Express.js web server using grunt.js
MIT License
254 stars 41 forks source link

Not serving when run via grunt-cocurent #52

Open srigi opened 10 years ago

srigi commented 10 years ago

Here is relevant configuration (inspired by yo generator-angular):

module.exports = (grunt) ->
  'use strict'

  require('load-grunt-tasks') grunt
  require('time-grunt') grunt
  path = require 'path'

  grunt.initConfig
    watch:
      compass:
        files: ['src/public/css/**/*.sass']
        tasks: ['compass:dev']

    compass:
      # ...

    express:
      dev:
        options:
          bases: path.resolve './src'
          port: 9000
          server: path.resolve './src/index'

    concurrent:
      dev: [
        'compass'
        'express:dev'
      ]

  grunt.registerTask 'default', [
    'concurrent:dev'
    'watch'
  ]

In this setup, when ran as grunt, Navigating to localhost:9000 results to page not available in the browser. When I run the same Gruntfile as grunt express:dev watch (not using concurent), everything is fine.