Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js Azure上的节点,Express API应用程序提供容器启动失败错误_Node.js_Azure_Express_Azure Web App Service - Fatal编程技术网

Node.js Azure上的节点,Express API应用程序提供容器启动失败错误

Node.js Azure上的节点,Express API应用程序提供容器启动失败错误,node.js,azure,express,azure-web-app-service,Node.js,Azure,Express,Azure Web App Service,我有一个现有的节点和Express API应用程序,我正在尝试将其部署到Azure WebApps。部署进展顺利。但是当我尝试访问API时,什么都没有发生。当我检查日志时,我看到以下内容:“容器chdemoapi_0_f2df43ac没有响应端口8080上的HTTP ping,站点启动失败”“容器chdemoapi_0_4e583132没有响应端口8080上的HTTP ping,站点启动失败” 以下是我的index.js文件的外观:     const config = require('./c

我有一个现有的节点和Express API应用程序,我正在尝试将其部署到Azure WebApps。部署进展顺利。但是当我尝试访问API时,什么都没有发生。当我检查日志时,我看到以下内容:“容器chdemoapi_0_f2df43ac没有响应端口8080上的HTTP ping,站点启动失败”“容器chdemoapi_0_4e583132没有响应端口8080上的HTTP ping,站点启动失败” 以下是我的index.js文件的外观:

    const config = require('./common/config/env.config.js');

const express = require('express');
const app = express();
const bodyParser = require('body-parser');

const AuthorizationRouter = require('./auth/routes.config');
const LeadsRouter = require('./leads/routes.config');
const DemoRouter = require('./demo/routes.config');
const MentorRouter = require('./mentors/routes.config');



app.use(function (req, res, next) {
    res.header('Access-Control-Allow-Origin', '*');
    res.header('Access-Control-Allow-Credentials', 'true');
    res.header('Access-Control-Allow-Methods', 'GET,HEAD,PUT,PATCH,POST,DELETE');
    res.header('Access-Control-Expose-Headers', 'Content-Length');
    res.header('Access-Control-Allow-Headers', 'Accept, Authorization, Content-Type, X-Requested-With, Range, x-access-token');
    if (req.method === 'OPTIONS') {
        return res.send(200);
    } else {
        return next();
    }
});

app.use(bodyParser.json());
AuthorizationRouter.routesConfig(app);
LeadsRouter.routesConfig(app);
DemoRouter.routesConfig(app);
MentorRouter.routesConfig(app);



app.listen(config.port, function () {
    console.log('app listening at port %s', config.port);
});
{"name": "ch-demo-services",      
"version": "1.0.0",      
"description": "microservices for demo module",      
"main": "index.js",      
"start":"node index.js",      
"scripts": {"test": 
"echo \"Error: no test specified\" && exit 1"},      
"author": "",      "license": "ISC",      
"dependencies": { "express": "^4.17.1", "generate-password": "^1.5.1",        
"jsonwebtoken": "^8.5.1",        "mailgen": "^2.0.13",        "moment": "^2.27.0",        "mongoose": 
"^5.9.18",        "nodemailer": "^6.4.10",        "uuid": "^8.1.0"      }    }    
以下是我的env.config文件的外观:

 module.exports = {        "port": 3600,        
//"appEndpoint": "http://localhost:3600",        
//"apiEndpoint": "http://localhost:3600",        
"appEndpoint": "https://chdemoapi.azurewebsites.net:3600",       
 "apiEndpoint": "https://chdemoapi.azurewebsites.net:3600",       
 "jwt_expiration_in_seconds": 36000,        
"environment": "dev",    
};
以下是my package.json文件的外观:

    const config = require('./common/config/env.config.js');

const express = require('express');
const app = express();
const bodyParser = require('body-parser');

const AuthorizationRouter = require('./auth/routes.config');
const LeadsRouter = require('./leads/routes.config');
const DemoRouter = require('./demo/routes.config');
const MentorRouter = require('./mentors/routes.config');



app.use(function (req, res, next) {
    res.header('Access-Control-Allow-Origin', '*');
    res.header('Access-Control-Allow-Credentials', 'true');
    res.header('Access-Control-Allow-Methods', 'GET,HEAD,PUT,PATCH,POST,DELETE');
    res.header('Access-Control-Expose-Headers', 'Content-Length');
    res.header('Access-Control-Allow-Headers', 'Accept, Authorization, Content-Type, X-Requested-With, Range, x-access-token');
    if (req.method === 'OPTIONS') {
        return res.send(200);
    } else {
        return next();
    }
});

app.use(bodyParser.json());
AuthorizationRouter.routesConfig(app);
LeadsRouter.routesConfig(app);
DemoRouter.routesConfig(app);
MentorRouter.routesConfig(app);



app.listen(config.port, function () {
    console.log('app listening at port %s', config.port);
});
{"name": "ch-demo-services",      
"version": "1.0.0",      
"description": "microservices for demo module",      
"main": "index.js",      
"start":"node index.js",      
"scripts": {"test": 
"echo \"Error: no test specified\" && exit 1"},      
"author": "",      "license": "ISC",      
"dependencies": { "express": "^4.17.1", "generate-password": "^1.5.1",        
"jsonwebtoken": "^8.5.1",        "mailgen": "^2.0.13",        "moment": "^2.27.0",        "mongoose": 
"^5.9.18",        "nodemailer": "^6.4.10",        "uuid": "^8.1.0"      }    }    
在应用程序设置中,我还添加了网站\u端口:3600。 在我的localhost中,我访问API的方式如下:http://localhost:3600/listDemoSlotsAfter 部署到Azure时,我正在尝试访问它们,如:。但是什么也没发生,我看到上面的日志。
我的设置有什么问题。

从错误消息的角度来看,是端口问题


Azure Web应用程序服务。建议更换
https://chdemoapi.azurewebsites.net:3600
https://chdemoapi.azurewebsites.net:443
。然后重新启动应用程序。

从错误消息的角度来看,这是端口问题


Azure Web应用程序服务。建议更换
https://chdemoapi.azurewebsites.net:3600
https://chdemoapi.azurewebsites.net:443
。然后重新启动应用程序。

您的问题解决了吗?您的问题解决了吗?