|
1 | 1 | # Google App Engine Node.js Samples
|
2 | 2 |
|
3 |
| -These are samples for using Node.js on Google App Engine Flexible Environment. These |
4 |
| -samples are referenced from the [docs](https://cloud.google.com/appengine/docs). |
| 3 | +These are samples for using [Node.js][nodejs] on |
| 4 | +[Google App Engine Flexible Environment][appengine]. Many of these samples |
| 5 | +are referenced from the documentation on [cloud.google.com][appengine]. |
5 | 6 |
|
6 |
| -See our other [Google Cloud Platform github repos](https://github.com/GoogleCloudPlatform) |
7 |
| -for sample applications and scaffolding for other frameworks and use cases. |
| 7 | +There are also samples [submitted by the community][community_samples]. |
8 | 8 |
|
9 |
| -## Run Locally |
| 9 | +See our other [Google Cloud Platform GitHub repositories](/GoogleCloudPlatform) |
| 10 | +for sample applications and scaffolding for other frameworks and use cases. |
10 | 11 |
|
11 |
| -Some samples have specific instructions. If there is a README in the sample |
12 |
| -folder, please refer to it for any additional steps required to run the sample. |
| 12 | +* [Run Locally](#run-locally) |
| 13 | +* [Deploying](#deploying) |
| 14 | +* [Official samples](#official-samples) |
| 15 | +* [Community samples](#community-samples) |
13 | 16 |
|
14 |
| -In general, the samples typically require: |
| 17 | +## Run Locally |
15 | 18 |
|
16 |
| -1. Install the [Google Cloud SDK](https://cloud.google.com/sdk/), including the |
17 |
| -[gcloud tool](https://cloud.google.com/sdk/gcloud/), and |
18 |
| -[gcloud app component](https://cloud.google.com/sdk/gcloud-app). |
19 |
| -1. Setup the gcloud tool. This provides authentication to Google Cloud APIs and |
20 |
| -services. |
| 19 | +Some samples have specific instructions. If there is a `README.md` file in the |
| 20 | +sample folder, please refer to it for any additional steps required to run the |
| 21 | +sample. |
21 | 22 |
|
22 |
| - gcloud init |
| 23 | +The App Engine Node.js samples typically that you do the following: |
23 | 24 |
|
24 |
| -1. Acquire local credentials for autheticating with Google Cloud Platform APIs: |
| 25 | +1. [Setup your environment for Node.js developement][nodejs_dev]. |
| 26 | +1. [Install the Google Cloud SDK][sdk]. |
| 27 | +1. Acquire local credentials for authenticating with Google Cloud Platform APIs: |
25 | 28 |
|
26 |
| - gcloud beta auth application-default login |
| 29 | + gcloud auth application-default login |
27 | 30 |
|
28 |
| -1. Clone this repo: |
| 31 | +1. Clone this repo: |
29 | 32 |
|
30 | 33 | git clone https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git
|
31 | 34 |
|
32 |
| -1. Open a sample folder: |
| 35 | +1. Choose a sample: |
33 | 36 |
|
34 |
| - cd <sample-folder>/ |
| 37 | + cd appengine/sample-folder/ |
35 | 38 |
|
36 |
| -1. Install depedencies using `npm` or `yarn`: |
| 39 | +1. Install depedencies using `npm` or `yarn`: |
37 | 40 |
|
38 | 41 | npm install
|
39 | 42 |
|
40 | 43 | or
|
41 | 44 |
|
42 | 45 | yarn install
|
43 | 46 |
|
44 |
| -1. Run the sample with `npm` or `yarn`: |
| 47 | +1. Run the sample with `npm` or `yarn` (See the sample's `README.md` file for |
| 48 | + any additional setup): |
45 | 49 |
|
46 | 50 | npm start
|
47 | 51 |
|
48 | 52 | or
|
49 | 53 |
|
50 | 54 | yarn start
|
51 | 55 |
|
52 |
| -1. Visit the application at [http://localhost:8080](http://localhost:8080). |
| 56 | +1. Visit the application at [http://localhost:8080][]. |
53 | 57 |
|
54 | 58 | ## Deploying
|
55 | 59 |
|
56 | 60 | Some samples in this repositories may have special deployment instructions.
|
57 |
| -Refer to the README file in the sample folder. |
58 |
| - |
59 |
| -1. Use the [Google Developers Console](https://console.developer.google.com) to |
60 |
| -create a project/app id. (App id and project id are identical.) |
61 |
| -1. Setup the gcloud tool, if you haven't already. |
| 61 | +Refer to the `README.md` file in the sample folder. |
62 | 62 |
|
63 |
| - gcloud init |
| 63 | +1. Use the [Google Cloud Console][console] to create a Google Cloud Platform |
| 64 | + project. |
| 65 | +1. [Enable billing][billing] for your project. |
64 | 66 |
|
65 |
| -1. Use gcloud to deploy your app. |
| 67 | +1. Use the Cloud SDK to deploy your app. |
66 | 68 |
|
67 | 69 | gcloud app deploy
|
68 | 70 |
|
69 | 71 | Note: If there is a `yarn.lock` file then `yarn install` will be used during
|
70 | 72 | deployment. Delete the `yarn.lock` file to fall back to `npm install`.
|
71 | 73 |
|
72 |
| -1. Awesome! Your application is now live at `https://YOUR_PROJECT_ID.appspot.com`. |
73 |
| - |
74 |
| -## Samples |
75 |
| - |
76 |
| -__Google (Cloud) Products__ |
77 |
| - |
78 |
| -- Google Analytics - [Source code][aeanalytics_1] |
79 |
| -- Google Cloud Logging - [Source code][aelogging_1] |
80 |
| -- Google Cloud Pub/Sub - [Source code][aepubsub_1] |
81 |
| -- Google Cloud Storage - [Source code][aestorage_1] |
82 |
| - |
83 |
| -__Frameworks__ |
84 |
| - |
85 |
| -- Express.js - [Source code][express_1] | [App Engine Tutorial][express_2] | [Live demo][express_3] | [Documentation][express_4] |
86 |
| - - Express.js + Memcached Sessions - [Source code][express_5] | [Documentation][express_6] |
87 |
| -- Geddy.js - [Source code][geddy_1] | [App Engine Tutorial][geddy_2] | [Live demo][geddy_3] | [Documentation][geddy_4] |
88 |
| -- Hapi.js - [Source code][hapi_1] | [App Engine Tutorial][hapi_2] | [Live demo][hapi_3] | [Documentation][hapi_4] |
89 |
| -- Loopback.js - [Source code][loopback_1] | [App Engine Tutorial][loopback_2] | [Live demo][loopback_3] | [Documentation][loopback_4] |
90 |
| -- Koa.js - [Source code][koa_1] | [App Engine Tutorial][koa_2] | [Live demo][koa_3] | [Documentation][koa_4] |
91 |
| -- Kraken.js - [Source code][kraken_1] | [App Engine Tutorial][kraken_2] | [Live demo][kraken_3] | [Documentation][kraken_4] |
92 |
| -- Parse-server - [Source code][parse_1] |
93 |
| -- Restify.js - [Source code][restify_1] | [App Engine Tutorial][restify_2] | [Live demo][restify_3] | [Documentation][restify_4] |
94 |
| -- Sails.js - [Source code][sails_1] | [App Engine Tutorial][sails_2] | [Live demo][sails_3] | [Documentation][sails_4] |
95 |
| - |
96 |
| -__Databases__ |
97 |
| - |
98 |
| -- Google Cloud Datastore - [Source code][aedatastore_1] |
99 |
| -- Google Cloud SQL - [Source code][aecloudsql_1] |
100 |
| -- Memcached - [Source code][memcached_1] |
101 |
| -- MongoDB - [Source code][mongodb_1] | [App Engine Tutorial][mongodb_2] | [Documentation][mongodb_3] |
102 |
| -- Redis - [Source code][redis_1] | [App Engine Tutorial][redis_2] | [Documentation][redis_3] |
103 |
| - |
104 |
| -__Tools__ |
105 |
| - |
106 |
| -- gcloud-node - [Source code][gcloud_1] | [Documentation][gcloud_2] |
107 |
| -- Bower - [Source code][bower_1] | [App Engine Tutorial][bower_2] | [Documentation][bower_3] |
108 |
| -- Grunt - [Source code][grunt_1] | [App Engine Tutorial][grunt_2] | [Live demo][grunt_3] | [Documentation][grunt_4] |
109 |
| -- Mailgun - [Source code][mailgun_1] | [App Engine Tutorial][mailgun_2] | [Documentation][mailgun_3] |
110 |
| -- Sendgrid - [Source code][sendgrid_1] | [App Engine Tutorial][sendgrid_2] | [Documentation][sendgrid_3] |
111 |
| -- Twilio - [Source code][twilio_1] |
112 |
| -- Webpack - [Source code][webpack_1] | [App Engine Tutorial][webpack_2] | [Documentation][webpack_3] |
113 |
| -- WebSockets - [Source code][websockets_1] |
114 |
| - |
115 |
| -__Other Examples__ |
116 |
| - |
117 |
| -- Express.js Hello World - [Source code][expresshw_1] |
118 |
| -- Extending the runtime - [Source code][aeextending_1] |
119 |
| -- Reading/writing from/to disk - [Source code][aedisk_1] |
120 |
| -- Serving static files - [Source code][aestaticfiles_1] |
121 |
| - |
122 |
| -[aeanalytics_1]: analytics |
123 |
| -[aelogging_1]: logging |
124 |
| -[aepubsub_1]: pubsub |
125 |
| -[aestorage_1]: storage |
126 |
| - |
127 |
| -[express_1]: express |
128 |
| -[express_2]: https://cloud.google.com/nodejs/resources/frameworks/express |
129 |
| -[express_3]: http://express-dot-nodejs-docs-samples.appspot.com |
130 |
| -[express_4]: http://expressjs.com/ |
131 |
| -[express_5]: express-memcached-session |
132 |
| -[express_6]: https://github.com/balor/connect-memcached |
133 |
| - |
134 |
| -[geddy_1]: geddy |
135 |
| -[geddy_2]: https://cloud.google.com/nodejs/resources/frameworks/geddy |
136 |
| -[geddy_3]: http://geddy-dot-nodejs-docs-samples.appspot.com |
137 |
| -[geddy_4]: http://geddyjs.org/ |
138 |
| - |
139 |
| -[hapi_1]: hapi |
140 |
| -[hapi_2]: https://cloud.google.com/nodejs/resources/frameworks/hapi |
141 |
| -[hapi_3]: http://hapi-dot-nodejs-docs-samples.appspot.com |
142 |
| -[hapi_4]: http://hapijs.com/ |
143 |
| - |
144 |
| -[loopback_1]: loopback |
145 |
| -[loopback_2]: https://cloud.google.com/nodejs/resources/frameworks/loopback |
146 |
| -[loopback_3]: http://loopback-dot-nodejs-docs-samples.appspot.com |
147 |
| -[loopback_4]: http://loopback.io/ |
148 |
| - |
149 |
| -[koa_1]: koa |
150 |
| -[koa_2]: https://cloud.google.com/nodejs/resources/frameworks/koa |
151 |
| -[koa_3]: http://koa-dot-nodejs-docs-samples.appspot.com |
152 |
| -[koa_4]: http://koajs.com/ |
153 |
| - |
154 |
| -[kraken_1]: kraken |
155 |
| -[kraken_2]: https://cloud.google.com/nodejs/resources/frameworks/kraken |
156 |
| -[kraken_3]: http://kraken-dot-nodejs-docs-samples.appspot.com |
157 |
| -[kraken_4]: http://krakenjs.com/ |
158 |
| - |
159 |
| -[parse_1]: parse-server |
160 |
| - |
161 |
| -[restify_1]: restify |
162 |
| -[restify_2]: https://cloud.google.com/nodejs/resources/frameworks/restify |
163 |
| -[restify_3]: http://restify-dot-nodejs-docs-samples.appspot.com |
164 |
| -[restify_4]: http://restify.com/ |
165 |
| - |
166 |
| -[sails_1]: sails |
167 |
| -[sails_2]: https://cloud.google.com/nodejs/resources/frameworks/sails |
168 |
| -[sails_3]: http://sails-dot-nodejs-docs-samples.appspot.com |
169 |
| -[sails_4]: http://sailsjs.org/ |
170 |
| - |
171 |
| -[aedatastore_1]: datastore |
172 |
| -[aecloudsql_1]: cloudsql |
173 |
| -[memcached_1]: memcached |
174 |
| - |
175 |
| -[mongodb_1]: mongodb |
176 |
| -[mongodb_2]: https://cloud.google.com/nodejs/resources/databases/mongodb |
177 |
| -[mongodb_3]: https://docs.mongodb.org/ |
178 |
| - |
179 |
| -[redis_1]: redis |
180 |
| -[redis_2]: https://cloud.google.com/nodejs/resources/databases/redis |
181 |
| -[redis_3]: https://redis.io/ |
182 |
| - |
183 |
| -[gcloud_1]: https://github.com/GoogleCloudPlatform/gcloud-node |
184 |
| -[gcloud_2]: https://googlecloudplatform.github.io/gcloud-node/#/ |
185 |
| - |
186 |
| -[bower_1]: bower |
187 |
| -[bower_2]: https://cloud.google.com/nodejs/resources/tools/bower |
188 |
| -[bower_3]: http://bower.io/ |
189 |
| - |
190 |
| -[grunt_1]: grunt |
191 |
| -[grunt_2]: https://cloud.google.com/nodejs/resources/tools/grunt |
192 |
| -[grunt_3]: http://grunt-dot-nodejs-docs-samples.appspot.com |
193 |
| -[grunt_4]: http://gruntjs.com/ |
194 |
| - |
195 |
| -[mailgun_1]: mailgun |
196 |
| -[mailgun_2]: https://cloud.google.com/nodejs/resources/tools/mailgun |
197 |
| -[mailgun_3]: http://www.mailgun.com/ |
198 |
| - |
199 |
| -[sendgrid_1]: sendgrid |
200 |
| -[sendgrid_2]: https://cloud.google.com/nodejs/resources/tools/sendgrid |
201 |
| -[sendgrid_3]: http://sendgrid.com/ |
202 |
| - |
203 |
| -[twilio_1]: twilio |
204 |
| - |
205 |
| -[webpack_1]: webpack |
206 |
| -[webpack_2]: https://cloud.google.com/nodejs/resources/tools/webpack |
207 |
| -[webpack_3]: https://webpack.github.io/ |
208 |
| - |
209 |
| -[websockets_1]: websockets |
210 |
| - |
211 |
| -[expresshw_1]: hello-world |
212 |
| -[aedisk_1]: disk |
213 |
| -[aeextending_1]: extending-runtime |
214 |
| -[aestaticfiles_1]: static-files |
| 74 | +1. View your deployed application at `https://YOUR_PROJECT_ID.appspot.com`. |
| 75 | + |
| 76 | +## Official samples |
| 77 | + |
| 78 | +View the [Official App Engine Node.js samples][official_samples]. |
| 79 | + |
| 80 | +## Community samples |
| 81 | + |
| 82 | +View the [Community-contributed App Engine Node.js samples][community_samples]. |
| 83 | + |
| 84 | +[nodejs]: https://nodejs.org/ |
| 85 | +[appengine]: https://cloud.google.com/appengine/docs/flexible/nodejs/ |
| 86 | +[nodejs_dev]: https://cloud.google.com/community/tutorials/how-to-prepare-a-nodejs-dev-environment |
| 87 | +[sdk]: https://cloud.google.com/sdk/ |
| 88 | +[console]: https://console.cloud.google.com |
| 89 | +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing |
| 90 | +[official_samples]: https://github.com/GoogleCloudPlatform/nodejs-docs-samples/tree/master/appengine |
| 91 | +[community_samples]: https://cloud.google.com/community/tutorials/?q=%22Node.js%22 |
0 commit comments