Skip to content

Latest commit

 

History

History
 
 

appengine

Google App Engine Node.js Samples

These are samples for using Node.js on Google App Engine Flexible Environment. Many of these samples are referenced from the documentation on cloud.google.com.

There are also samples submitted by the community.

See our other Google Cloud Platform GitHub repositories for sample applications and scaffolding for other frameworks and use cases.

Run Locally

Some samples have specific instructions. If there is a README.md file in the sample folder, please refer to it for any additional steps required to run the sample.

The App Engine Node.js samples typically that you do the following:

  1. Setup your environment for Node.js developement.

  2. Install the Google Cloud SDK.

  3. Acquire local credentials for authenticating with Google Cloud Platform APIs:

    gcloud auth application-default login
    
  4. Clone this repo:

    git clone https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git
    
  5. Choose a sample:

    cd appengine/sample-folder/
    
  6. Install depedencies using npm or yarn:

    npm install
    

    or

    yarn install
    
  7. Run the sample with npm or yarn (See the sample's README.md file for any additional setup):

    npm start
    

    or

    yarn start
    
  8. Visit the application at [http://localhost:8080][].

Deploying

Some samples in this repositories may have special deployment instructions. Refer to the README.md file in the sample folder.

  1. Use the Google Cloud Console to create a Google Cloud Platform project.

  2. Enable billing for your project.

  3. Use the Cloud SDK to deploy your app.

    gcloud app deploy
    

    Note: If there is a yarn.lock file then yarn install will be used during deployment. Delete the yarn.lock file to fall back to npm install.

  4. View your deployed application at https://YOUR_PROJECT_ID.appspot.com.

Official samples

View the Official App Engine Node.js samples.

Community samples

View the Community-contributed App Engine Node.js samples.