-
Notifications
You must be signed in to change notification settings - Fork 54
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
Multiple functions in the same package #308
Comments
I've tried setting up a simple experiment with two functions, @CloudFunction()
Response foo(Request request) => Response.ok('Hello, World! (foo)');
@CloudFunction()
Response bar(Request request) => Response.ok('Hello, World! (bar)'); The FunctionTarget? _nameToFunctionTarget(String name) {
switch (name) {
case 'foo':
return FunctionTarget.http(
function_library.foo,
);
case 'bar':
return FunctionTarget.http(
function_library.bar,
);
default:
return null;
}
}
But after building a container using the provided
How can I build (& deploy to the Cloud Run, preferably) such trivial two-functions package? |
The default function is You need to provide the |
@kevmoo Thank you very much for your answer, but please be aware that from my perspective this issue is not closed. Thank you for a link to the functions-framework project. Would you point me to the place in the functions-framework-dart project that states that these two projects are interconnected? I can see that the names are similar and I can guess the relationship between them, but stating such relationship in the readme / docs is necessary, in my opinion. I wouldn't know how the functions-framework-dart user is expected to guess that they should look for information in the I might should have noted, that such direct I'll also repeat the questions from my original posts. Am I correct to assume that the intended usage (of functions-framework-dart) is similar to the official Firebase Functions JavaScript SDK, where you can define dozens of functions in the single file? Should I conclude that the answer is "yes"? How can I build (& deploy to the Cloud Run, preferably) such trivial two-functions package? Does the provided Am I right to assume that if I have multiple functions in my functions-framework-dart -based project, I'll need a separate Cloud Run service per single in-code |
Referring to "the handler function" and suggesting a descriptive name like
handleGet
implies that it's correct / typical to have only one function defined infunctions.dart
file. But it's not the case, right? The file is named functions. And there's a_nameToFunctionTarget
generated helper method.Am I correct to assume that the intended usage is similar to the official Firebase Functions JavaScript SDK, where you can define dozens of functions in the single file?
The text was updated successfully, but these errors were encountered: