You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 3, 2024. It is now read-only.
* Your application will need to be using Node.js version 0.12 or greater. Node.js v5+ is recommended. (Node.js v5.2.0 is not supported on account of [this bug](https://github.com/nodejs/node/issues/4297))
16
+
* Your application will need to be using Node.js version 0.12 or greater. Node.js v5+ is recommended.
17
17
* The source of your application is uploaded to a [cloud source repository](https://cloud.google.com/tools/cloud-repositories/docs/). The Debugger UI needs the source to be available in order to set breakpoints.
18
18
19
19
## Quick Start (Node.js v4.x+)
20
20
```shell
21
21
# Install with `npm` or add to your `package.json`.
22
22
npm install --save @google/cloud-debug
23
23
24
-
# Change the start command of your application in package.json
# Require the agent at the top of your main script.
25
+
require('@google/cloud-debug');
29
26
```
30
27
Deploy your application, and navigate to the [Debug tab][debug-tab] within the [Google Developers Console][dev-console] to set breakpoints and start debugging.
31
28
32
-
## Installation
33
-
34
-
1. Install the debug agent module via `npm` or add it to your `package.json`.
35
-
36
-
```shell
37
-
npm install --save @google/cloud-debug
38
-
```
39
-
1. Ensure that the module gets loaded during your application's startup. The best way to do this is via the `--require` command line option available in Node.js v4. You should add this option to the startup script section in your `package.json`.
If you are using Node.js v0.12.x, you will not be able to use the `--require` command line option. Instead you will have to manually load the debug agent module in the startup script of your application. For example, you may want to add the following
46
-
to your `server.js`:
47
-
```javascript
48
-
require('@google/cloud-debug');
49
-
```
50
-
51
29
## Running on Google Cloud Platform
52
30
53
31
There are three different services that can host Node.js application to Google Cloud Platform.
@@ -72,13 +50,13 @@ Container Engine nodes need to also be created with the `cloud-platform` scope,
72
50
73
51
If your application is running outside of Google Cloud Platform, such as locally, on-premise, or on another cloud provider, you can still use Cloud Debug.
74
52
75
-
1. You will need to specify the numeric project ID of your project. Your numeric project ID, or project number, is visible the Project information section on your project's [dashboard][dashboard].
53
+
1. You will need to specify your project name. Your project name is visible in the [Google Cloud Console][cloud-console-projects], it may be something like `particular-future-12345`. If your application is [running on Google Cloud Platform](running-on-google-cloud-platform), you don't need to specify the project name.
2. You need to provide service account credentials to your application. The recommended way is via [Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials).
57
+
2. You need to provide service account credentials to your application. The recommended way is via [Application Default Credentials][app-default-credentials].
80
58
81
-
1. [Create a new JSON service account key](https://console.developers.google.com/apis/credentials/serviceaccountkey).
59
+
1.[Create a new JSON service account key][service-account].
82
60
2. Copy the key somewhere your application can access it. Be sure not to expose the key publicly.
83
61
3. Set the environment variable `GOOGLE_APPLICATION_CREDENTIALS` to the full path to the key. The debug agent will automatically look for this environment variable.
84
62
@@ -110,10 +88,12 @@ As soon as that line of code is reached in any of the running instances of your
0 commit comments