File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
cloud-tasks/tutorial-gcf/app Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ runtime: nodejs16
1919env_variables :
2020 QUEUE_NAME : " my-queue"
2121 QUEUE_LOCATION : " us-central1"
22- FUNCTION_URL : " https://<region>-<project_id>.cloudfunctions.net/sendEmail "
22+ FUNCTION_URL : " https://<region>-<project_id>.cloudfunctions.net/send-email "
2323 SERVICE_ACCOUNT_EMAIL : " <member>@<project_id>.iam.gserviceaccount.com"
2424# [END cloud_tasks_app_env_vars]
2525
Original file line number Diff line number Diff line change @@ -28,12 +28,12 @@ const {SERVICE_ACCOUNT_EMAIL} = process.env;
2828app . use ( express . urlencoded ( { extended : true } ) ) ;
2929
3030// [START cloud_tasks_app]
31- app . post ( '/send-email' , ( req , res ) => {
31+ app . post ( '/send-email' , async ( req , res ) => {
3232 // Set the task payload to the form submission.
3333 const { to_name, from_name, to_email, date} = req . body ;
3434 const payload = { to_name, from_name, to_email} ;
3535
36- createHttpTaskWithToken (
36+ await createHttpTaskWithToken (
3737 process . env . GOOGLE_CLOUD_PROJECT ,
3838 QUEUE_NAME ,
3939 QUEUE_LOCATION ,
You can’t perform that action at this time.
0 commit comments