阅读(3908) (0)

Micronaut Google Cloud Function

2023-02-23 13:44:09 更新

Micronaut GCP 子项目中实现了对 Google Cloud Function 的支持。

具有云功能的简单功能

您可以使用直接实现 Cloud Function Framework API 的 Micronaut 实现 Cloud Functions。

使用 CLI

要创建 Google 云函数:

$ mn create-function-app my-app --features google-cloud-function

或者使用 Micronaut Launch

$ curl https://launch.micronaut.io/create/function/example\?features\=google-cloud-function -o example.zip
$ unzip example.zip -d example

具有云函数的 HTTP 函数

您可以使用 Micronaut 对 HTTP 函数的支持来部署使用 @Controller 等的常规 Micronaut 应用程序。

使用 CLI

要创建 Google Cloud HTTP 函数:

$ mn create-app my-app --features google-cloud-function

或者使用 Micronaut Launch

$ curl https://launch.micronaut.io/example.zip\?features\=google-cloud-function -o example.zip
$ unzip example.zip -d example