Skip to content

Commit

Permalink
Stackdriver samples (#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry authored Jun 22, 2017
1 parent 17c3c8c commit ea819fc
Show file tree
Hide file tree
Showing 14 changed files with 727 additions and 458 deletions.
8 changes: 4 additions & 4 deletions debugger/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
* limitations under the License.
*/

// [START app]
// [START debugger_app]
'use strict';

// [START setup]
// [START debugger_setup_implicit]
require('@google-cloud/debug-agent').start();
// [END debugger_setup_implicit]

const express = require('express');
const app = express();

app.enable('trust proxy');
// [END setup]

app.get('/', (req, res) => {
// Try using the StackDriver Debugger dashboard to inspect the "req" object
Expand All @@ -38,6 +38,6 @@ if (module === require.main) {
console.log('Press Ctrl+C to quit.');
});
}
// [END app]
// [END debugger_app]

module.exports = app;
2 changes: 1 addition & 1 deletion debugger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"e2e-test": "samples test deploy"
},
"dependencies": {
"@google-cloud/debug-agent": "2.1.0",
"@google-cloud/debug-agent": "2.1.1",
"express": "4.15.3"
},
"devDependencies": {
Expand Down
23 changes: 23 additions & 0 deletions debugger/snippets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Copyright 2017, Google, Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// [START debugger_setup_explicit]
require('@google-cloud/debug-agent').start({
projectId: 'your-project-id',
keyFilename: '/path/to/key.json'
});
// [END debugger_setup_explicity]
12 changes: 4 additions & 8 deletions debugger/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
string-format-obj "^1.1.0"
through2 "^2.0.3"

"@google-cloud/debug-agent@2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@google-cloud/debug-agent/-/debug-agent-2.1.0.tgz#7c0622456bde975a2b80292a07827324e857b63a"
"@google-cloud/debug-agent@2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@google-cloud/debug-agent/-/debug-agent-2.1.1.tgz#2015364bf6ac3e25f10f059b6bff8ad49106a22a"
dependencies:
"@google-cloud/common" "^0.13.3"
acorn "^5.0.3"
Expand Down Expand Up @@ -2373,18 +2373,14 @@ minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4:
dependencies:
brace-expansion "^1.1.7"

minimist@0.0.8:
minimist@0.0.8, minimist@~0.0.1:
version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"

minimist@^1.1.3, minimist@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"

minimist@~0.0.1:
version "0.0.10"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"

"mkdirp@>=0.5 0", mkdirp@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
Expand Down
Loading

0 comments on commit ea819fc

Please sign in to comment.