Skip to content

Latest commit

 

History

History
 
 

computeengine

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Google Cloud Platform logo

Google Compute Engine Node.js Samples

Compute Engine lets you create and run virtual machines on Google infrastructure.

Table of Contents

Setup

  1. Read Prerequisites and How to run a sample first.

  2. Install dependencies:

    With npm:

    npm install
    

    With yarn:

    yarn install
    

Samples

Sending mail with Sendgrid

View the documentation or the source code.

Run the sample:

  1. Set the SENDGRID_API_KEY environment variable:

     export SENDGRID_API_KEY=<your-sendgrid-api-key>
    
  2. Start the server:

     node sendgrid
    
  3. Open http://localhost:8080 in your browser

Sending mail with Mailjet

View the documentation or the source code.

Run the sample:

  1. Set the MAILJET_API_KEY environment variable:

     export MAILJET_API_KEY=<your-mailjet-api-key>
    
  2. Set the MAILJET_API_SECRET environment variable:

     export MAILJET_API_SECRET=<your-mailjet-api-secret>
    
  3. Start the server:

     node mailjet
    
  4. Open http://localhost:8080 in your browser

Listing instances (recommended)

View the documentation or the source code.

Run the sample:

node vms

Listing instances

View the documentation or the source code.

Run the sample:

node vms_api

Running the tests

  1. Set the GCLOUD_PROJECT and GOOGLE_APPLICATION_CREDENTIALS environment variables.

  2. Run the tests:

    With npm:

    npm test
    

    With yarn:

    yarn test