File tree 2 files changed +7
-2
lines changed
functions/concepts/afterResponse
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 15
15
'use strict' ;
16
16
17
17
// [START functions_concepts_after_response]
18
+ const functions = require ( '@google-cloud/functions-framework' ) ;
19
+
18
20
/**
19
21
* HTTP Cloud Function that may not completely
20
22
* execute due to early HTTP response
21
23
*
22
24
* @param {Object } req Cloud Function request context.
23
25
* @param {Object } res Cloud Function response context.
24
26
*/
25
- exports . afterResponse = ( req , res ) => {
27
+ functions . http ( ' afterResponse' , ( req , res ) => {
26
28
res . end ( ) ;
27
29
28
30
// This statement may not execute
29
31
console . log ( 'Function complete!' ) ;
30
- } ;
32
+ } ) ;
31
33
// [END functions_concepts_after_response]
Original file line number Diff line number Diff line change 10
10
},
11
11
"engines" : {
12
12
"node" : " >=12.0.0"
13
+ },
14
+ "dependencies" : {
15
+ "@google-cloud/functions-framework" : " ^3.1.3"
13
16
}
14
17
}
You can’t perform that action at this time.
0 commit comments