我的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.
那么我错误的是服务器无法启动?