GCF: Add Node 8 background function samples#779
Conversation
ace-n
reviewed
Oct 23, 2018
functions/node8/index.js
Outdated
| * @returns {Promise} | ||
| */ | ||
| exports.helloPromise = (data) => { | ||
| const request = require('request-promise'); |
Contributor
There was a problem hiding this comment.
Can you move this outside of the function, and use two region tag blocks? e.g:
// [START tag_name]
const library = require('library');
// [END tag_name]
...
// [START tag_name]
exports.useLibrary = () => {
...
}
// [END tag_name]
Author
There was a problem hiding this comment.
Sure, I copied this from the original Node 6 sample though: https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/master/functions/background/index.js#L47-L53
Should that one be changed as well?
Contributor
|
Also - can you add (unit) tests, or should I do that? |
Author
|
@ace-n Can you add unit tests? I can't get the tests running locally. |
|
CLAs look good, thanks! |
ace-n
approved these changes
Nov 1, 2018
Contributor
ace-n
left a comment
There was a problem hiding this comment.
Made edits + added tests. LGTM to me if it does to you.
Author
|
Looks good to me, thanks! |
This was referenced May 10, 2022
This was referenced May 10, 2022
This was referenced May 11, 2022
ace-n
pushed a commit
that referenced
this pull request
Nov 17, 2022
🤖 I have created a release *beep* *boop* --- ## [7.0.0](googleapis/nodejs-translate@v6.3.1...v7.0.0) (2022-06-30) ### ⚠ BREAKING CHANGES * update library to use Node 12 (#789) ### Features * support regapic LRO ([#798](googleapis/nodejs-translate#798)) ([9f1ddc1](googleapis/nodejs-translate@9f1ddc1)) ### Bug Fixes * **deps:** update dependency @google-cloud/common to v4 ([#793](googleapis/nodejs-translate#793)) ([a2d079b](googleapis/nodejs-translate@a2d079b)) * **test:** fix language detection test ([#779](googleapis/nodejs-translate#779)) ([b6df5e2](googleapis/nodejs-translate@b6df5e2)) ### Build System * update library to use Node 12 ([#789](googleapis/nodejs-translate#789)) ([3060301](googleapis/nodejs-translate@3060301)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
ace-n
pushed a commit
that referenced
this pull request
Nov 17, 2022
🤖 I have created a release *beep* *boop* --- ## [7.0.0](googleapis/nodejs-translate@v6.3.1...v7.0.0) (2022-06-30) ### ⚠ BREAKING CHANGES * update library to use Node 12 (#789) ### Features * support regapic LRO ([#798](googleapis/nodejs-translate#798)) ([9f1ddc1](googleapis/nodejs-translate@9f1ddc1)) ### Bug Fixes * **deps:** update dependency @google-cloud/common to v4 ([#793](googleapis/nodejs-translate#793)) ([a2d079b](googleapis/nodejs-translate@a2d079b)) * **test:** fix language detection test ([#779](googleapis/nodejs-translate#779)) ([b6df5e2](googleapis/nodejs-translate@b6df5e2)) ### Build System * update library to use Node 12 ([#789](googleapis/nodejs-translate#789)) ([3060301](googleapis/nodejs-translate@3060301)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
ace-n
pushed a commit
that referenced
this pull request
Nov 17, 2022
🤖 I have created a release *beep* *boop* --- ## [7.0.0](googleapis/nodejs-translate@v6.3.1...v7.0.0) (2022-06-30) ### ⚠ BREAKING CHANGES * update library to use Node 12 (#789) ### Features * support regapic LRO ([#798](googleapis/nodejs-translate#798)) ([9f1ddc1](googleapis/nodejs-translate@9f1ddc1)) ### Bug Fixes * **deps:** update dependency @google-cloud/common to v4 ([#793](googleapis/nodejs-translate#793)) ([a2d079b](googleapis/nodejs-translate@a2d079b)) * **test:** fix language detection test ([#779](googleapis/nodejs-translate#779)) ([b6df5e2](googleapis/nodejs-translate@b6df5e2)) ### Build System * update library to use Node 12 ([#789](googleapis/nodejs-translate#789)) ([3060301](googleapis/nodejs-translate@3060301)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
ace-n
pushed a commit
that referenced
this pull request
Nov 17, 2022
🤖 I have created a release *beep* *boop* --- ## [7.0.0](googleapis/nodejs-translate@v6.3.1...v7.0.0) (2022-06-30) ### ⚠ BREAKING CHANGES * update library to use Node 12 (#789) ### Features * support regapic LRO ([#798](googleapis/nodejs-translate#798)) ([9f1ddc1](googleapis/nodejs-translate@9f1ddc1)) ### Bug Fixes * **deps:** update dependency @google-cloud/common to v4 ([#793](googleapis/nodejs-translate#793)) ([a2d079b](googleapis/nodejs-translate@a2d079b)) * **test:** fix language detection test ([#779](googleapis/nodejs-translate#779)) ([b6df5e2](googleapis/nodejs-translate@b6df5e2)) ### Build System * update library to use Node 12 ([#789](googleapis/nodejs-translate#789)) ([3060301](googleapis/nodejs-translate@3060301)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
renovate-bot
pushed a commit
to renovate-bot/nodejs-docs-samples
that referenced
this pull request
Nov 17, 2022
🤖 I have created a release *beep* *boop* --- ## [7.0.0](googleapis/nodejs-translate@v6.3.1...v7.0.0) (2022-06-30) ### ⚠ BREAKING CHANGES * update library to use Node 12 (GoogleCloudPlatform#789) ### Features * support regapic LRO ([GoogleCloudPlatform#798](googleapis/nodejs-translate#798)) ([9f1ddc1](googleapis/nodejs-translate@9f1ddc1)) ### Bug Fixes * **deps:** update dependency @google-cloud/common to v4 ([GoogleCloudPlatform#793](googleapis/nodejs-translate#793)) ([a2d079b](googleapis/nodejs-translate@a2d079b)) * **test:** fix language detection test ([GoogleCloudPlatform#779](googleapis/nodejs-translate#779)) ([b6df5e2](googleapis/nodejs-translate@b6df5e2)) ### Build System * update library to use Node 12 ([GoogleCloudPlatform#789](googleapis/nodejs-translate#789)) ([3060301](googleapis/nodejs-translate@3060301)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding
helloPromiseandhelloSynchronoussamples for Node 8 to illustrate returning a Promise and a synchronously returning a result.