File tree 5 files changed +92
-1
lines changed
workflows/invoke-private-endpoint
5 files changed +92
-1
lines changed Original file line number Diff line number Diff line change 91
91
" translate" ,
92
92
" video-intelligence" ,
93
93
" vision/productSearch" ,
94
- " workflows"
94
+ " workflows" ,
95
+ " workflows/invoke-private-endpoint"
95
96
]
Original file line number Diff line number Diff line change
1
+ # Node.js sample for "Invoke a VPC Service Controls-compliant private endpoint"
2
+
3
+ This is the sample application for the
4
+ [ Invoke a VPC Service Controls-compliant private endpoint] ( https://cloud.google.com/workflows/docs/invoke-private-endpoint-vpc )
5
+ page found in the [ Google Cloud Workflows] ( https://cloud.google.com/workflows/docs ) documentation.
Original file line number Diff line number Diff line change
1
+ // Copyright 2023 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // https://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ 'use strict' ;
16
+
17
+ // [START workflows_private_endpoint]
18
+ const express = require ( 'express' ) ;
19
+ const app = express ( ) ;
20
+
21
+ app . get ( '/' , ( req , res ) => {
22
+ res . status ( 200 ) . send ( 'Hello, world!' ) . end ( ) ;
23
+ } ) ;
24
+
25
+ app . listen ( 3000 , ( ) => {
26
+ console . log ( 'Sample app listening on port 3000.' ) ;
27
+ } ) ;
28
+ // [END workflows_private_endpoint]
29
+
30
+ module . exports = app ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " workflows-hello-private-endpoint" ,
3
+ "description" : " Simple Hello World Node.js sample for Workflows" ,
4
+ "version" : " 1.0.0" ,
5
+ "private" : true ,
6
+ "license" : " Apache-2.0" ,
7
+ "author" : " Google Inc." ,
8
+ "repository" : {
9
+ "type" : " git" ,
10
+ "url" : " https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
11
+ },
12
+ "engines" : {
13
+ "node" : " >=14.0.0"
14
+ },
15
+ "scripts" : {
16
+ "start" : " node app.js" ,
17
+ "test" : " c8 mocha --exit test/*.test.js"
18
+ },
19
+ "dependencies" : {
20
+ "express" : " ^4.17.1"
21
+ },
22
+ "devDependencies" : {
23
+ "c8" : " ^7.13.0" ,
24
+ "mocha" : " ^10.0.0" ,
25
+ "supertest" : " ^6.0.0"
26
+ }
27
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2023 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // https://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ const app = require ( '../app' ) ;
16
+ const request = require ( 'supertest' ) ;
17
+
18
+ describe ( 'workflows_private_endpoint' , ( ) => {
19
+ describe ( 'GET /' , ( ) => {
20
+ it ( 'should get 200' , done => {
21
+ request ( app ) . get ( '/' ) . expect ( 200 , done ) ;
22
+ } ) ;
23
+
24
+ it ( 'should get Hello World' , done => {
25
+ request ( app ) . get ( '/' ) . expect ( 'Hello, world!' , done ) ;
26
+ } ) ;
27
+ } ) ;
28
+ } ) ;
You can’t perform that action at this time.
0 commit comments