我Gruntfile
的是:
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'
我server.coffee
的也超级简单:
'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
但是当我这样做时grunt start
,我得到:
Running "concurrent:tasks" (concurrent) task
Running "nodemon:dev" (nodemon) task
Done, without errors.
那么我做错了什么,服务器无法启动?