|
1 | | -<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/> |
| 1 | +Samples for the [Google Compute Engine API Node.js Client][client] have moved to |
| 2 | +[github.com/googleapis/nodejs-compute/tree/master/samples/][samples]. |
2 | 3 |
|
3 | | -# Google Compute Engine Node.js Samples |
4 | | - |
5 | | -[Compute Engine][compute_docs] lets you create and run virtual machines on |
6 | | -Google infrastructure. |
7 | | - |
8 | | -[compute_docs]: https://cloud.google.com/compute/docs/ |
9 | | - |
10 | | -## Table of Contents |
11 | | - |
12 | | -* [Setup](#setup) |
13 | | -* [Samples](#samples) |
14 | | - * [Sending mail with Sendgrid](#sending-mail-with-sendgrid) |
15 | | - * [Sending mail with Mailjet](#sending-mail-with-mailjet) |
16 | | - * [Listing instances (recommended)](#listing-instances-recommended) |
17 | | - * [Listing instances](#listing-instances) |
18 | | -* [Running the tests](#running-the-tests) |
19 | | - |
20 | | -## Setup |
21 | | - |
22 | | -1. Read [Prerequisites][prereq] and [How to run a sample][run] first. |
23 | | -1. Install dependencies: |
24 | | - |
25 | | - With `npm`: |
26 | | - |
27 | | - npm install |
28 | | - |
29 | | - With `yarn`: |
30 | | - |
31 | | - yarn install |
32 | | - |
33 | | -[prereq]: ../README.md#prerequisities |
34 | | -[run]: ../README.md#how-to-run-a-sample |
35 | | - |
36 | | -## Samples |
37 | | - |
38 | | -### Sending mail with Sendgrid |
39 | | - |
40 | | -View the [documentation][sendgrid_docs] or the [source code][sendgrid_code]. |
41 | | - |
42 | | -__Run the sample:__ |
43 | | - |
44 | | -1. Set the `SENDGRID_API_KEY` environment variable: |
45 | | - |
46 | | - export SENDGRID_API_KEY=<your-sendgrid-api-key> |
47 | | - |
48 | | -1. Start the server: |
49 | | - |
50 | | - node sendgrid |
51 | | - |
52 | | -1. Open http://localhost:8080 in your browser |
53 | | - |
54 | | -[sendgrid_docs]: https://cloud.google.com/compute/docs/tutorials/sending-mail/using-sendgrid |
55 | | -[sendgrid_code]: sendgrid.js |
56 | | - |
57 | | -### Sending mail with Mailjet |
58 | | - |
59 | | -View the [documentation][mailjet_docs] or the [source code][mailjet_code]. |
60 | | - |
61 | | -__Run the sample:__ |
62 | | - |
63 | | -1. Set the `MAILJET_API_KEY` environment variable: |
64 | | - |
65 | | - export MAILJET_API_KEY=<your-mailjet-api-key> |
66 | | - |
67 | | -1. Set the `MAILJET_API_SECRET` environment variable: |
68 | | - |
69 | | - export MAILJET_API_SECRET=<your-mailjet-api-secret> |
70 | | - |
71 | | -1. Start the server: |
72 | | - |
73 | | - node mailjet |
74 | | - |
75 | | -1. Open http://localhost:8080 in your browser |
76 | | - |
77 | | -[mailjet_docs]: https://cloud.google.com/compute/docs/tutorials/sending-mail/using-mailjet |
78 | | -[mailjet_code]: mailjet.js |
79 | | - |
80 | | -### Listing instances (recommended) |
81 | | - |
82 | | -View the [documentation][vms_docs] or the [source code][vms_code]. |
83 | | - |
84 | | -__Run the sample:__ |
85 | | - |
86 | | - node vms |
87 | | - |
88 | | -[vms_docs]: https://cloud.google.com/compute/docs/tutorials/nodejs-guide |
89 | | -[vms_code]: vms.js |
90 | | - |
91 | | -### Listing instances |
92 | | - |
93 | | -View the [documentation][vms_api_docs] or the [source code][vms_api_code]. |
94 | | - |
95 | | -__Run the sample:__ |
96 | | - |
97 | | - node vms_api |
98 | | - |
99 | | -[vms_api_docs]: https://cloud.google.com/compute/docs/tutorials/nodejs-guide |
100 | | -[vms_api_code]: vms_api.js |
101 | | - |
102 | | -## Running the tests |
103 | | - |
104 | | -1. Set the `GCLOUD_PROJECT` and `GOOGLE_APPLICATION_CREDENTIALS` environment |
105 | | - variables. |
106 | | - |
107 | | -1. Run the tests: |
108 | | - |
109 | | - With `npm`: |
110 | | - |
111 | | - npm test |
112 | | - |
113 | | - With `yarn`: |
114 | | - |
115 | | - yarn test |
| 4 | +[client]: https://github.com/googleapis/nodejs-compute |
| 5 | +[samples]: https://github.com/googleapis/nodejs-compute/tree/master/samples |
0 commit comments