[英]Express app deployed successfully on Azure but still nothing work
Azure deployed this app with successfully flag, but homepage response with 500 status Azure 使用成功标志部署了此应用程序,但主页响应状态为 500
index.js:索引.js:
const express = require("express");
const app = express();
app.get("/", (req, res) => {
res.send("Hello!");
});
app.listen(3000, () => console.log("Hwllo!"));
package.json:包.json:
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.17.1"
}
}
Have you tried setting the variable process.env.PORT
for handling the named pipe port in Azure App Service.您是否尝试过设置变量
process.env.PORT
来处理 Azure 应用服务中的命名管道端口。 See Listen additional port Microsoft Azure Nodejs.请参阅侦听附加端口 Microsoft Azure Nodejs。
If it does not solve your issue, try to go through KUDU console and look for the particular erros.如果它不能解决您的问题,请尝试通过 KUDU 控制台并查找特定的错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.