Azure Web App on Linux: “Error: Container didn't respond to HTTP pings on port: 8080” - when using: “start”: “pm2 start server.js”

后端 未结 3 707
-上瘾入骨i
-上瘾入骨i 2021-01-13 15:31

My App Service Linux instance crashes if my node app is using the start script: \"start\": \"pm2 start server.js\":

2019-04-15 11:36:34.432 ERRO         


        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-13 15:39

    I was having the same issue. When I changed the code in my server.js file to the below it succesfully ran:

    const port = process.env.port || 8080;
    

    After redeploying to Azure it is now working.

提交回复
热议问题