GoogleCloudPlatform / GoogleCloudPlatform/functions-framework-nodejs

Deploy multiple TypeScript functions to Google Cloud

Aperta
#610 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
P3 question
Lingua principale
TypeScript
Stelle
1.4k
Fork
181
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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?`

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with docs/typescript.md and the package.json and build/functions layout described in the issue. Verify the expected source directory and main field for deploying multiple Node.js 22 functions, then document a working multi-function deployment path that answers both questions and addresses the reported missing package.json error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
google-cloud, nodejs, typescript
Ambito
cloud, documentation
Tipo di issue
Documentazione
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.