-
Nice to meet you, I'm new to GCP and this may be a basic question. OverviewI want to deploy two different functions for GCP. But I could not deploy them. My code is as followings: import 'package:functions_framework/functions_framework.dart';
import 'package:shelf/shelf.dart';
@CloudFunction(target: 'hello-world')
Response helloWorld(Request request) {
return Response.ok('Hello, world!');
}
@CloudFunction(target: 'next-world')
Response nextWorld(Request request) {
return Response.ok('Next World!');
} And, I use the following command. $ gcloud beta run deploy hello --allow-unauthenticated --source=. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
We probably need to surface this better – https://github.com/GoogleCloudPlatform/functions-framework-dart/blob/main/docs/quickstarts/01-quickstart-dart.md#changing-the-default-function-name
|
Beta Was this translation helpful? Give feedback.
We probably need to surface this better – https://github.com/GoogleCloudPlatform/functions-framework-dart/blob/main/docs/quickstarts/01-quickstart-dart.md#changing-the-default-function-name
function
is the default, but if you want to override it you need to set theFUNCTION_TARGET
environment variable when you deploy!