- Notifications
You must be signed in to change notification settings - Fork0
Node.js samples for Google Cloud Platform products.
License
acidburn0zzz/nodejs-docs-samples
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Node.js samples forGoogle Cloud Platform products.
Seecloud.google.com/nodejs to get up and running with Node.json Google Cloud Platform.
- Setup
- Client libraries
- Code samples
- Other sample applications
- Contributing
- License
InstallNode.js v4.5.0 or greater
Clone this repository:
git clone https://github.com/GoogleCloudPlatform/nodejs-docs-samples.gitChange directory in to the project:
cd nodejs-docs-samplesSet the
GCLOUD_PROJECTenvironment variable:Linux:
export GCLOUD_PROJECT=your-project-idWindows:
set GCLOUD_PROJECT=your-project-idWindows (PowerShell):
$env:GCLOUD_PROJECT="your-project-id"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 loginIn non-Google Cloud environments, GCE instances created without thecorrect scopes, or local workstations where the
gcloud beta auth application-default logincommand 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 the
GOOGLE_APPLICATION_CREDENTIALSenvironment variable to point to the file containing the JSON credentials.
Set the
GOOGLE_APPLICATION_CREDENTIALSenvironment variable:Linux:
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service_account_file.jsonWindows:
set GOOGLE_APPLICATION_CREDENTIALS=/path/to/service_account_file.jsonWindows (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-instanceIf you did not create the instance with the right scopes, you can stillupload a JSON service account and set
GOOGLE_APPLICATION_CREDENTIALSas described.Read more aboutGoogle Cloud Platform Authentication.
Change directory to one of the sample folders, e.g.
bigquery:cd bigquery/Install the sample's dependencies (see the sample's README for details):
npm installor
yarn installNote: Use
npmoryarnexclusively, don't mix them.Run the sample:
node sample_file.js [args]...
The recommended, idiomatic client for Google Cloud Platform services.
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.
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.
Compute Engine lets you create and run virtual machines onGoogle infrastructure.
View theCompute Engine Node.js samples.
Container Engine: Run Docker containers on Google CloudPlatform, powered by Kubernetes.
View theContainer Engine Node.js samples.
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.
Cloud Spanner is a managed, mission-critical, globallyconsistent and scalable relational database service.
View theCloud Spanner Node.js samples.
Cloud Datastore is a NoSQL document database built forautomatic scaling, high performance, and ease of application development.
View theCloud Datastore Node.js samples.
Cloud Storage allows world-wide storage and retrieval of anyamount of data at any time.
View theCloud Storage Node.js samples.
BigQuery is Google's fully managed, petabyte scale, low costanalytics data warehouse.
View theBigQuery Node.js samples.
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.
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.
TheCloud Prediction API provides a RESTful API to buildMachine Learning models.
View theCloud Prediction API Node.js samples.
TheCloud Speech API enables easy integration of Google speechrecognition technologies into developer applications.
View theCloud Speech API Node.js samples.
With theGoogle Translate API, you can dynamically translatetext between thousands of language pairs.
View theTranslate API Node.js samples.
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.
Stackdriver Debugger makes it easier to view the applicationstate without adding logging statements.
View theStackdriver Debugger Node.js sample.
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 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 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.
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.
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.
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 is a NodeJS app that uses the Google Cloud PredictionAPI to automatically label GitHub Issues as they are created.
View thetutorial or thesource code.
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.
Contributions welcome! See theContributing Guide.
Apache Version 2.0
SeeLICENSE
About
Node.js samples for Google Cloud Platform products.
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Languages
- JavaScript98.4%
- Other1.6%