Skip to content
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

Serving multiple functions locally from a single server instance #109

Closed
nikcorg opened this issue Jan 21, 2022 · 4 comments · Fixed by #143 or #154
Closed

Serving multiple functions locally from a single server instance #109

nikcorg opened this issue Jan 21, 2022 · 4 comments · Fixed by #143 or #154
Assignees

Comments

@nikcorg
Copy link

nikcorg commented Jan 21, 2022

When #95 was merged, the ability to serve several functions from one instance locally broke. I'm not sure whether it was ever intended to be possible, but since it was, we've been relying on it.

Let me elaborate just a bit. We have a single project from which we deploy 4 separate functions to Cloud Run. For convenience, in our local dev environments, we serve them all from a single server and port by registering each function with a separate call to funcframework.RegisterHTTPFunctionContext (previously funcframework.RegisterHTTPFunction).

This was possible in 1.2.0 (yep, I've missed a few versions 😊), but broke when I upgraded to the most recent version.

It's still possible by passing an http.ServeMux to funcframework.RegisterHTTPFunctionContext or functions.HTTP, but that seems more of a "chaotic lawful" solution than an actual solution.

@kevpie
Copy link

kevpie commented Feb 10, 2022

Was expecting to be able to do this.
I want to use the firebase functions httpsCallable signature on the frontend and route that to functions or cloud run or anywhere. Some of this may be more firebase specific.

I wish the Handlers construction and Path registration were separate like a simple http.Serve application.

@codyoss
Copy link
Member

codyoss commented Feb 18, 2022

cc @grant

@grant
Copy link
Contributor

grant commented Feb 18, 2022

Thanks for the report.

@anniefu are you able to look at this and understand why this is happening?

It seems like the fix is a breaking change. Maybe the setup is unexpected. Either way, we should test registering and serving multiple functions.

@aexvir
Copy link

aexvir commented Mar 6, 2022

just started looking into swtiching from my "custom" way of doing this to the gcf framework and I was also surprised this isn't working 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment