Hosted Targets troubleshooting

Build/Deploy failed due to missing package.json

A package.json file is required in the root directory of your Node.js app. Any attempt to create/deploy a proxy without a package.json will fail at build time.

Receiving 502 Bad Gateway From Proxy

A "502 Bad Gateway" error can occur when the process fails to start. To debug this check the runtime logs and look for error messages when starting. A common error is a missing or invalid start command in the package.json. At a minimum the package.json should specify "start": "node ." in the scripts property. For example:

{
  "name": "hello-world",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
   "start": "node ."
  },
  "author": "",
  "license": "",
  "description": "Hello World Application",
  "dependencies": {
  }
}

Proxy Hangs and Returns 504 Gateway Timeout

A "504 Gateway Timeout" error can occur when the Hosted Targets target app does not respond within a timeout limit. Check to ensure that your application is listening on the port set in the environment variable PORT. You can access this variable with process.env.PORT in your application. Otherwise you can check the runtime logs for any other error messages. See also Environment variables set in the application runtime.