简体   繁体   English

在 Azure 上成功部署 Express 应用程序,但仍然没有任何效果

[英]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.

相关问题 通过GitHub部署时,Express 4应用程序在Azure中不起作用 - Express 4 app doesn't work in Azure when deployed via GitHub 成功将节点应用程序部署到OpenShift,OpenShift仍显示默认页面 - Deployed Node app to OpenShift successfully, OpenShift still shows default page 通过Visual Studio部署时Express 4应用程序无法在Azure中运行 - Express 4 app doesn't work in Azure when deployed via Visual Studio 部署的 Nodejs 服务在 Azure Web 应用程序上不起作用 - Deployed Nodejs service does not work on Azure Web App 为什么使用 Express 应用时 setTimeout 仍然有效? - Why does setTimeout still work when using an Express app? React 应用程序成功部署到 heroku 但状态未更新 - React app deployed to heroku successfully but state is not updating 405在使用Azure Web应用程序部署的Express Angle 5应用程序上不允许使用方法 - 405 Method not allowed on express angular 5 app deployed using azure web app express js api端点不适用于azure Web应用程序 - express js api end point does not work on azure web app Express 中的响应流在 Azure 应用服务中不起作用 - Response streaming in Express does not work in Azure App Service Express.js应用程序在本地可以正常运行,但是在Heroku上部署时无法正常工作 - Express.js app works fine locally but doesn't work when deployed on Heroku
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM