GoogleCloudPlatform / GoogleCloudPlatform/functions-framework-nodejs
Feature request: export "main" entrypoint to allow using it directly instead of using the cli
- 主要言語
- TypeScript
- スター
- 1.4k
- フォーク
- 181
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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
コントリビューションガイド
調査の方向性
まず、既存のCLI起動パスと、functions-frameworkでエクスポートされているmainエントリポイントを追跡します。このリクエストでは、src/server.jsまたはsrc/server.tsをNodeの直接エントリポイントとして提案しています。ユーザーがmainを直接呼び出せ、現在のCLIの動作が維持されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- node.js, typescript
- 領域
- backend, cli
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100