GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — nodejs-getting-started/5-logging at master · roypj/nodejs-getting-started

Expand file tree

/

5-logging

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

5-logging

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
books
books
 
 
lib
lib
 
 
test
test
 
 
views
views
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
app.js
app.js
 
 
app.yaml
app.yaml
 
 
config.js
config.js
 
 
key.json.enc
key.json.enc
 
 
package.json
package.json
 
 

README.md

Outline

5 - Logging app events

Cloud SQL Build Status Datastore Build Status

This folder contains the sample code for the Logging app events tutorial. Please refer to the tutorial for instructions on configuring, running, and deploying this sample.

Simple instructions

  1. Install Node.js.

    • Optional: Install Yarn.
  2. Install git.

  3. Create a Google Cloud Platform project.

  4. Install the Google Cloud SDK.

    • After downloading the SDK, initialize it:

        gcloud init
      
  5. Acquire local credentials for authenticating with Google Cloud Platform services:

    gcloud beta auth application-default login
    
  6. Clone the repository:

    git clone https://github.com/GoogleCloudPlatform/nodejs-getting-started.git
    
  7. Change directory:

    cd nodejs-getting-started/5-logging
    
  8. Create a config.json file (copied from the config-default.json file):

    cp config-default.json config.json
    
    • Set GCLOUD_PROJECT in config.json to your Google Cloud Platform project ID.
    • Set DATA_BACKEND in config.json to "datastore" or "cloudsql".
    • Set CLOUD_BUCKET in config.json to the name of your Google Cloud Storage bucket.
    • Set OAUTH2_CLIENT_ID in config.json.
    • Set OAUTH2_CLIENT_SECRET in config.json.
    • Set MEMCACHE_URL in config.json.
    • (If applicable) Set MEMCACHE_USERNAME and MEMCACHE_PASSWORD in config.json.
  9. Install dependencies using NPM or Yarn:

    • Using NPM:

        npm install
      
    • Using Yarn:

        yarn install
      
  10. Configure the backing store:

    • If DATA_BACKEND is set to "cloudsql":

      1. Create a Cloud SQL instance, and download and start the Cloud SQL proxy:

        Instructions for doing so: https://cloud.google.com/nodejs/getting-started/using-cloud-sql#creating_a_cloud_sql_instance

      2. Set MYSQL_USER in config.json, e.g. "my-cloudsql-username".

      3. Set MYSQL_PASSWORD in config.json, e.g. "my-cloudsql-password".

      4. Set INSTANCE_CONNECTION_NAME in config.json, e.g. "YOUR_PROJECT_ID:YOUR_REGION:YOUR_INSTANCE_ID".

      5. Run the script to setup the table:

        • Using NPM:

            npm run init-cloudsql
          
        • Using Yarn:

            yarn run init-cloudsql
          
  11. Start the app using NPM or Yarn:

    • Using NPM:

        npm start
      
    • Using Yarn:

        yarn start
      
  12. View the app at http://localhost:8080.

  13. Stop the app by pressing Ctrl+C.

  14. Deploy the app:

    gcloud app deploy
    
  15. View the deployed app at https://YOUR_PROJECT_ID.appspot.com.

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.