GoogleCloudPlatform / GoogleCloudPlatform/functions-framework-nodejs

Deploy multiple TypeScript functions to Google Cloud

Open
#610 1 comment 0 reactions 0 assignees View on GitHub
P3 question
Dominant language
TypeScript
Stars
1.4k
Forks
181
PR merge metrics
No merged PRs in 30d

Description

How can I build and deploy multiple TS cloud functions from the same codebase?

I'm following your TS guide which focuses on the single function use case -> [docs/typescript.md](https://github.com/GoogleCloudPlatform/functions-framework-nodejs/blob/main/docs/typescript.md)

Project structure :
![image](https://github.com/GoogleCloudPlatform/functions-framework-nodejs/assets/22203676/69b53aca-98bf-4d41-8f1a-73025da7ed66)

Deploy command :

`gcloud functions deploy catalogUpdateFunction \
--gen2 \
--region=europe-north1 \
--runtime=nodejs22 \
--source=. \
--entry-point=catalogUpdateFunction \
--trigger-http
`

Open questions:

1. What should be the value of the main field in package.json ?
2. What should the source be for the deploy command?

Setting the source value to ` --source=./build/functions \` fails with the following error: `ERROR: (gcloud.functions.deploy) Invalid value for [--source]: Provided source directory does not have file [package.json] which is required for [nodejs22]. Did you specify the right source?`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.