更新时间:2023-02-24 14:31:00
你能展示你调用 listen
的整个代码部分吗?您应该检查流程环境变量 PORT,而不仅仅是将其硬编码为 3000.来自他们的 docs一个>:
Can you show the entire section of code where you call listen
? You should be checking for the process environment variable PORT, not just hardcoding it to 3000. From their docs:
var port = process.env.PORT || 3000;
app.listen(port, function() {