GoogleCloudPlatform / GoogleCloudPlatform/functions-framework-nodejs

Deploy multiple TypeScript functions to Google Cloud

Abierto
#610 1 comentario 0 reacciones 0 asignados Ver en GitHub
P3 question
Lenguaje dominante
TypeScript
Estrellas
1.4k
Forks
181
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con docs/typescript.md y con la estructura de package.json y build/functions descrita en la issue. Verifica el directorio de código fuente esperado y el campo main para desplegar varias funciones de Node.js 22; después, documenta un proceso de despliegue de varias funciones que funcione, responda a ambas preguntas y aborde el error indicado de que falta package.json.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
google-cloud, nodejs, typescript
Área
cloud, documentation
Tipo de issue
Documentación
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.