我有以下 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。