Deploy Web app to Google App Engine!
Deploy NodeJS App to Google App Engine.
- Create a new project
- Navigate to Google Cloud Dashboard
- Click “New Project”
- Give project a name, and click “Create”
- Create a skeleton NodeJS webapp
- create a skeleton NodeJS webapp (express) with the following file structure:
- In
package.json
file, make sure to specify the node version - In
package.json
file, include the following for google cloud related testing - In
app.yaml
file, specify the NodeJS version - An example app can be found at This Repo
- To get this app running in local ( assuming you have the correct NodeJS version installed),do
yarn install
,yarn start
, and navigate to Localhost to see the result
- Getting ready to deploy to Google App Engine
- If you are using a Mac, go to Google SDK to download the google cloud sdk
- In terminal, install the sdk by running:
{LOCATION_OF_DOWNLOADED_SDK}/google-cloud-sdk/install.sh
- Restart the terminal to pick up the change
- cd into the NodeJS webapp directory, and do
glcoud init
to initialize the gcloud config - Create a new configuration or chose existing configuration
- Choose an existing gcloud account
- Deploy app to Google App Engine
- Enter
gcloud app deploy
and choose a region - confirm deployment summary
- It will show deployment is in progress
- It will finish deploying the app in some time. Based on the information provided, you can navigate to
https://<app_project_id>.appspot.com
to access the web app. Here is mine
- Enter
Written on October 13, 2018