javascript - Heroku 在部署时不指定端口

标签 javascript mongodb heroku deployment continuous-deployment

我的index.js:

const PORT = process.env.PORT || 8453;

app.listen(PORT, () => console.log("Server in listening on port: " + PORT));

但是,在部署日志中:

Running build (yarn)
yarn run v1.22.4
$ node src/index.js
Server in listening on port: 8453

最佳答案

这是您在本地运行代码时的日志。 Heroku 日志看起来不同。

关于javascript - Heroku 在部署时不指定端口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61035610/

相关文章:

javascript - 如何在 ember-cli 中使用 New Relic?

ruby-on-rails - 使用 Heroku 多个环境时无效的 DATABASE_URL

javascript - 即使在客户端,是否有办法保护 React JS 中的 API key ?

javascript - Tokbox 相机过滤器 API 问题

javascript - CF推送错误: An application could not be detected by any available buildpack

django - 使用 MongoEngine 查询 ReferenceFields

python - 如何使用 Django-MongoDB 引擎根据模型上 DictField 中的字典内容进行过滤?

javascript - 具有相同#id 的多个按钮执行相同的功能?

javascript - errmsg : 'Unsupported projection option: $push: { ... }' , 代码 : 2, codeName: 'BadValue' }

ruby-on-rails - heroku push 上的 Ruby 版本更改