小编G. *_*ner的帖子

“Hello-World”node.js/express 在本地工作,但不在 Azure Web App 上工作

我有以下 node.js/express 文件index.js

var express = require('express');
var app = express();

app.get('/', function (req, res) {
  res.send('Hello World!');
});

var port = process.env.PORT || 1337;
app.listen(port);
console.log("Server running at http://localhost:%d", port);
Run Code Online (Sandbox Code Playgroud)

当我在本地运行服务器并在浏览器上访问http://localhost:1337/时,我得到“Hello World!” 正如预期的那样。我在 Azure Web App 上部署了 index.js,但当我尝试访问它时,收到“ERR_CONNECTION_TIMED_OUT”。

我究竟做错了什么?

我已经在 Azure 上安装了 Express。

azure node.js express azure-web-app-service

5
推荐指数
1
解决办法
3544
查看次数

标签 统计

azure ×1

azure-web-app-service ×1

express ×1

node.js ×1