Question

My Gruntfile is:

module.exports = (grunt) ->
  grunt.initConfig
    pkg: grunt.file.readJSON 'package.json'

    concurrent:
      tasks: [
        'nodemon'
      ]

    nodemon:
     dev:
        options:
          script: "server.coffee"
          args: []
          ignoredFiles: ["public/**"]
          watchedExtensions: ["coffee"]
          nodeArgs: ["--debug"]
          delayTime: 1
          env:
            PORT: 9001

          cwd: __dirname

  require('load-grunt-tasks')(grunt)

  grunt.registerTask 'start', 'concurrent'

My server.coffee is also super simple:

'use strict'

express = require 'express'
winston = require 'winston'

config = require('environmental-configuration')('./config')

app = express()

app.listen config.port
winston.info "App started on port #{config.port}"

module.exports = app

But when I do grunt start, I get:

Running "concurrent:tasks" (concurrent) task

    Running "nodemon:dev" (nodemon) task

Done, without errors.

So what am I doing wrong that the server won't start?

Was it helpful?

Solution

I think grunt doesn't know to call the script configured in nodemon, perhaps take a look at Running a command in a Grunt Task

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top