Deploy Nuxt.js to Google App Engine Return 502 Bad Gateway

允我心安 提交于 2019-12-04 19:18:25

Below worked for me.

package.json

"start": "npm install --save cross-env && nuxt build && cross-env NODE_ENV=production node server/index.js",

This install cross-env before serving and nuxt build is a required command in production.

Plus I've changes in server.js

Add health route to express:

  app.get('/_ah/health', (req, res) => {
    res.status(200)
    res.send({hello:'world'})
  })

Listen to only port

// app.listen(host,port) 
app.listen(port)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!