Skip to content

Feature request: export "main" entrypoint to allow using it directly instead of using the cli #692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cctidal opened this issue May 9, 2025 · 0 comments

Comments

@cctidal
Copy link

cctidal commented May 9, 2025

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:

import {main} from 'functions-framework'

import {handle} from './index.js'

main(handle)

I'd be willing to implement this feature

@cctidal cctidal changed the title Feature request: export "main" entrypoint to allow using it directly instead of using the CI Feature request: export "main" entrypoint to allow using it directly instead of using the cli May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants