These are samples for using Node.js on Google App Engine Flexible Environment. These samples are referenced from the docs.
See our other Google Cloud Platform github repos for sample applications and scaffolding for other frameworks and use cases.
Some samples have specific instructions. If there is a README in the sample folder, please refer to it for any additional steps required to run the sample.
In general, the samples typically require:
-
Install the Google Cloud SDK, including the gcloud tool, and gcloud app component.
-
Setup the gcloud tool. This provides authentication to Google Cloud APIs and services.
gcloud init
-
Acquire local credentials for autheticating with Google Cloud Platform APIs:
gcloud beta auth application-default login
-
Clone this repo:
git clone https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git
-
Open a sample folder:
cd <sample-folder>/
-
Install depedencies using
npm
oryarn
:npm install
or
yarn install
-
Run the sample with
npm
oryarn
:npm start
or
yarn start
-
Visit the application at http://localhost:8080.
Some samples in this repositories may have special deployment instructions. Refer to the README file in the sample folder.
-
Use the Google Developers Console to create a project/app id. (App id and project id are identical.)
-
Setup the gcloud tool, if you haven't already.
gcloud init
-
Use gcloud to deploy your app.
gcloud app deploy
Note: If there is a
yarn.lock
file thenyarn install
will be used during deployment. Delete theyarn.lock
file to fall back tonpm install
. -
Awesome! Your application is now live at
https://YOUR_PROJECT_ID.appspot.com
.
Google (Cloud) Products
- Google Analytics - Source code
- Google Cloud Logging - Source code
- Google Cloud Pub/Sub - Source code
- Google Cloud Storage - Source code
Frameworks
- Express.js - Source code | App Engine Tutorial | Live demo | Documentation
- Express.js + Memcached Sessions - Source code | Documentation
- Geddy.js - Source code | App Engine Tutorial | Live demo | Documentation
- Hapi.js - Source code | App Engine Tutorial | Live demo | Documentation
- Loopback.js - Source code | App Engine Tutorial | Live demo | Documentation
- Koa.js - Source code | App Engine Tutorial | Live demo | Documentation
- Kraken.js - Source code | App Engine Tutorial | Live demo | Documentation
- Parse-server - Source code
- Restify.js - Source code | App Engine Tutorial | Live demo | Documentation
- Sails.js - Source code | App Engine Tutorial | Live demo | Documentation
Databases
- Google Cloud Datastore - Source code
- Google Cloud SQL - Source code
- Memcached - Source code
- MongoDB - Source code | App Engine Tutorial | Documentation
- Redis - Source code | App Engine Tutorial | Documentation
Tools
- gcloud-node - Source code | Documentation
- Bower - Source code | App Engine Tutorial | Documentation
- Grunt - Source code | App Engine Tutorial | Live demo | Documentation
- Mailgun - Source code | App Engine Tutorial | Documentation
- Sendgrid - Source code | App Engine Tutorial | Documentation
- Twilio - Source code
- Webpack - Source code | App Engine Tutorial | Documentation
- WebSockets - Source code
Other Examples
- Express.js Hello World - Source code
- Extending the runtime - Source code
- Reading/writing from/to disk - Source code
- Serving static files - Source code