Micronaut AWS Lambda

2023-03-13 09:33 更新

對(duì) AWS Lambda 的支持在 Micronaut AWS 子項(xiàng)目中實(shí)現(xiàn)。

使用 AWS Lambda 的簡(jiǎn)單函數(shù)

您可以使用直接實(shí)現(xiàn) AWS Lambda SDK API 的 Micronaut 實(shí)現(xiàn) AWS 請(qǐng)求處理程序。

使用 CLI

要?jiǎng)?chuàng)建 AWS Lambda 函數(shù):

$ mn create-function-app my-app --features aws-lambda

或者使用 Micronaut Launch

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

AWS Lambda 的 HTTP 函數(shù)

您可以使用 Micronaut 對(duì) AWS API Gateway 的支持來(lái)部署使用 @Controller 等的常規(guī) Micronaut 應(yīng)用程序。

使用 CLI

創(chuàng)建 AWS API Gateway 代理應(yīng)用程序:

$ mn create-app my-app --features aws-lambda

或者使用 Micronaut Launch

$ curl https://launch.micronaut.io/example.zip\?features\=aws-lambda -o example.zip
$ unzip example.zip -d example


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)