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/3-binary-data at master · CloudCodePoC/nodejs-getting-started

Expand file tree

/

3-binary-data

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

3-binary-data

/
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

3 - Cloud Storage

Cloud SQL Build Status Datastore Build Status MongoDB Build Status

This folder contains the sample code for the Cloud Storage 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/3-binary-data
    
  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 one of "datastore", "cloudsql", or "mongodb".
    • Set CLOUD_BUCKET in config.json to the name of your Google Cloud Storage bucket.
  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
          
    • If DATA_BACKEND is set to "mongodb":

      1. Set MONGO_URL in config.json, e.g. "mongodb://username:[email protected]:27017".
  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 01402775 — 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.