永远Node.JS Express 4 [英] Forever Node.JS Express 4

查看:165
本文介绍了永远Node.JS Express 4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何运行Express 4应用程序与Forever? (或有新的包吗?)

How do you run the Express 4 app with Forever? (or is there a new package?)

我正在运行我的Express 3应用程序与永远在本地与包管理器一起安装。我使用命令:

I am running my Express 3 apps with Forever installed locally with the package manager. I use the command:

forever -a start app.js


推荐答案

尝试这样:

forever start ./bin/www

我们来看看 .json

"scripts": {
    "start": "node ./bin/www"
},

我猜当我们调用 npm开始 ./ bin / www 将在某些时候执行。
然后查看 ./ bin / www 的内容:

I guess when we call npm start, ./bin/www will be executed at some point. Then look at the content of./bin/www:

var server = app.listen(app.get('port'), function() {
  debug('Express server listening on port ' + server.address().port);
});

所以我们准备好收听连接。

so we are ready to listen for connections.

这篇关于永远Node.JS Express 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆