GoogleCloudPlatform / GoogleCloudPlatform/functions-framework-nodejs
Feature request: export "main" entrypoint to allow using it directly instead of using the cli
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.4k
- Forks
- 181
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
I'm interested in using the main entrypoint function directly instead of using the cli to start up the function, mostly on the development environment.
This has some advantages, among others:
- Can be started with node directly: `node src/server.js`
- Can use node watcher, no need for extra setup with nodemon&others: `node --watch src/server.js`
- Better typescript support with ts-node/tsx: `tsx --watch src/server.ts`
This server.js would use the exported main entry point:
```js
import {main} from 'functions-framework'
import {handle} from './index.js'
main(handle)
```
I'd be willing to implement this feature
Guía de contribución
Línea de trabajo
Empieza siguiendo el flujo de inicio existente de CLI y el punto de entrada main exportado en functions-framework. La propuesta plantea src/server.js o src/server.ts como un punto de entrada directo de Node; se considera completado cuando los usuarios pueden invocar main directamente y se conserva el comportamiento actual de CLI.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- node.js, typescript
- Área
- backend, cli
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 48/100