DEV Community

Theresa
Theresa

Posted on

Quick Start Tips You Need for Node.js Deployment on App Engine

When trying to deploy your node app on App Engine, you might run into various blockers that can be difficult to diagnose.

Yesterday, my app was receiving 502 and 500 errors, depending on the tweak, and the official Google documentation on App Engine leave the deployment requirements to be desired.

[Here are the official docs on getting you nodejs project deployed on App Engine:

The solution for me, in short, was making sure I had an app.yaml file in the project root, WITH url handlers:

# [START runtime]
runtime: nodejs10
# [END runtime]

# [START handlers]
handlers:
 - url: /
   static_files: build/index.html
   upload: build/index.html

 - url: /(.*)
   static_files: build/\1
   upload: build/(.*)
# [END handlers]
Enter fullscreen mode Exit fullscreen mode

Other things you'll want to check:

  • your app.yaml file is in the root of your project
  • if you're paying, make sure payment is set up
  • make sure you ran npm run build (or equivalent) before gcloud app deploy
  • in start.js (or equivalent), set default port to 8080

Let me know if there are other tips, or outdated information here.

Discussion (0)