【发布时间】:2013-12-21 20:00:24
【问题描述】:
运行工头启动时,我看到以下消息
> foreman start
20:38:55 web.1 | started with pid 3896
20:38:55 web.1 | Development
20:38:56 web.1 | connect.multipart() will be removed in connect 3.0
20:38:56 web.1 | exited with code 1
20:38:56 system | sending SIGKILL to all processes
我想知道为什么会这样,因为运行 node server.js 似乎不会终止服务器。
这是导致应用程序以退出代码 1 终止的代码段:
var app = express();
app.configure(function()
{
// More config things above
app.use(express.bodyParser()); // This line is causing the issue
// More config things below
}
以上是使用Express.js 框架的代码。删除上述对 express.bodyParser() 的调用允许服务器运行(通过工头)。问题是,我需要 body 解析器模块来解析传入的 get/posts 请求。
对于这个问题的任何帮助将不胜感激。
【问题讨论】:
标签: javascript node.js heroku express foreman