Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Node.js samples for Google Cloud Platform products.

License

NotificationsYou must be signed in to change notification settings

acidburn0zzz/nodejs-docs-samples

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Cloud Platform logo

Google Cloud Platform Node.js SamplesSlackBuildCoverage

Node.js samples forGoogle Cloud Platform products.

Seecloud.google.com/nodejs to get up and running with Node.json Google Cloud Platform.

Table of Contents

Setup

Prerequisites

  1. InstallNode.js v4.5.0 or greater

  2. Clone this repository:

     git clone https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git
  3. Change directory in to the project:

     cd nodejs-docs-samples
  4. Set theGCLOUD_PROJECT environment variable:

    Linux:

     export GCLOUD_PROJECT=your-project-id

    Windows:

     set GCLOUD_PROJECT=your-project-id

    Windows (PowerShell):

     $env:GCLOUD_PROJECT="your-project-id"
  5. Obtain authentication credentials.

    Create local credentials by running the following command and following theoauth2 flow (read more about the commandhere):

     gcloud beta auth application-default login

    In non-Google Cloud environments, GCE instances created without thecorrect scopes, or local workstations where thegcloud beta auth application-default login command fails, use a serviceaccount by doing the following:

    • Go to API Manager -> Credentials
    • Click "New Credentials", and create a service account orclick here
    • Download the JSON for this service account, and set theGOOGLE_APPLICATION_CREDENTIALSenvironment variable to point to the file containing the JSON credentials.

    Set theGOOGLE_APPLICATION_CREDENTIALS environment variable:

    Linux:

     export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service_account_file.json

    Windows:

     set GOOGLE_APPLICATION_CREDENTIALS=/path/to/service_account_file.json

    Windows (PowerShell):

     $env:GOOGLE_APPLICATION_CREDENTIALS="/path/to/service_account_file.json"

    Note for code running on GCE, GAE, or other environments:

    On Google App Engine, the credentials should be found automatically.

    On Google Compute Engine, the credentials should be found automatically, but require thatyou create the instance with the correct scopes.

     gcloud compute instances create --scopes="https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/compute.readonly" test-instance

    If you did not create the instance with the right scopes, you can stillupload a JSON service account and setGOOGLE_APPLICATION_CREDENTIALSas described.

    Read more aboutGoogle Cloud Platform Authentication.

How to run a sample

  1. Change directory to one of the sample folders, e.g.bigquery:

     cd bigquery/
  2. Install the sample's dependencies (see the sample's README for details):

     npm install

    or

     yarn install

    Note: Usenpmoryarn exclusively, don't mix them.

  3. Run the sample:

     node sample_file.js [args]...

Client libraries

Google Cloud Platform logoGoogle Cloud Node.js client library

The recommended, idiomatic client for Google Cloud Platform services.

Google logoGoogle API Node.js client library

An older Node.js client library for making REST requests to Google APIs. Usethis for Google Cloud APIs that are not yet supported by the Google CloudNode.js client library.

Code samples

Compute

Google App Engine (flexible environment)

TheApp Engine flexible environment is based on Google ComputeEngine and automatically scales your app up and down while balancing the load.

View theApp Engine flexible environment Node.js samples.

Google Compute Engine

Compute Engine lets you create and run virtual machines onGoogle infrastructure.

View theCompute Engine Node.js samples.

Google Container Engine

Container Engine: Run Docker containers on Google CloudPlatform, powered by Kubernetes.

View theContainer Engine Node.js samples.

Google Cloud Functions (Beta)

Cloud Functions is a lightweight, event-based, asynchronouscompute solution that allows you to create small, single-purpose functions thatrespond to Cloud events without the need to manage a server or a runtimeenvironment.

View theCloud Functions Node.js samples.

Storage and Databases

Cloud Spanner

Cloud Spanner is a managed, mission-critical, globallyconsistent and scalable relational database service.

View theCloud Spanner Node.js samples.

Google Cloud Datastore

Cloud Datastore is a NoSQL document database built forautomatic scaling, high performance, and ease of application development.

View theCloud Datastore Node.js samples.

Google Cloud Storage

Cloud Storage allows world-wide storage and retrieval of anyamount of data at any time.

View theCloud Storage Node.js samples.

Big Data

Google BigQuery

BigQuery is Google's fully managed, petabyte scale, low costanalytics data warehouse.

View theBigQuery Node.js samples.

Google Cloud Pub/Sub

Cloud Pub/Sub is a fully-managed real-time messaging service thatallows you to send and receive messages between independent applications.

View theCloud Pub/Sub Node.js samples.

Machine Learning

Google Cloud Natural Language API

Cloud Natural Language API provides natural languageunderstanding technologies to developers, including sentiment analysis, entityrecognition, and syntax analysis. This API is part of the larger Cloud MachineLearning API.

View theCloud Natural Language API Node.js samples.

Google Cloud Prediction API

TheCloud Prediction API provides a RESTful API to buildMachine Learning models.

View theCloud Prediction API Node.js samples.

Google Cloud Speech API (Beta)

TheCloud Speech API enables easy integration of Google speechrecognition technologies into developer applications.

View theCloud Speech API Node.js samples.

Google Translate API

With theGoogle Translate API, you can dynamically translatetext between thousands of language pairs.

View theTranslate API Node.js samples.

Google Cloud Vision API

TheCloud Vision API allows developers to easily integrate visiondetection features within applications, including image labeling, face andlandmark detection, optical character recognition (OCR), and tagging of explicitcontent.

View theCloud Vision API Node.js samples.

Management Tools

Stackdriver Debugger

Stackdriver Debugger makes it easier to view the applicationstate without adding logging statements.

View theStackdriver Debugger Node.js sample.

Stackdriver Logging

Stackdriver Logging allows you to store, search, analyze,monitor, and alert on log data and events from Google Cloud Platform and AmazonWeb Services.

View theStackdriver Logging Node.js samples.

Stackdriver Monitoring

Stackdriver Monitoring collects metrics, events, and metadatafrom Google Cloud Platform, Amazon Web Services (AWS), hosted uptime probes,application instrumentation, and a variety of common application componentsincluding Cassandra, Nginx, Apache Web Server, Elasticsearch and many others.

View theStackdriver Monitoring Node.js samples.

Stackdriver Trace

Stackdriver Trace is a distributed tracing system for Google CloudPlatform that collects latency data from App Engine applications and displays itin near real time in the Google Cloud Platform Console.

View theStackdriver Trace Node.js sample.

Networking

Google Cloud DNS

Publish your domain names using Google's infrastructure for production-quality,high-volume DNS services. Google's global network of anycast name serversprovide reliable, low-latency authoritative name lookups for your domains fromanywhere in the world. Read more aboutGoogle Cloud DNS.

View theGoogle Cloud DNS Node.js sample.

Identity and Security

Google Cloud Key Management Service

TheCloud KMS API is a service that allows you to keep encryptionkeys centrally in the cloud, for direct use by cloud services.

View theGoogle Cloud Key Management Service Node.js sample.

Other sample applications

Bookshelf tutorial app

TheBookshelf app is a sample web app written in Node.js thatshows you how to use a variety of Google Cloud Platform features.

View thetutorial or thesource code.

LabelCat

LabelCat is a NodeJS app that uses the Google Cloud PredictionAPI to automatically label GitHub Issues as they are created.

View thetutorial or thesource code.

Node.js Codelab

In theNode.js Web App Google Cloud Platform codelab, you learnhow to integrate Google Cloud Platform services into a Node.js web applicationto store data, upload images, and authenticate users.

View thetutorial or thesource code.

Contributing

Contributions welcome! See theContributing Guide.

License

Apache Version 2.0

SeeLICENSE

About

Node.js samples for Google Cloud Platform products.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript98.4%
  • Other1.6%

[8]ページ先頭

©2009-2025 Movatter.jp