Skip to main content

Crate autumn_plugin_aws_lambda

Crate autumn_plugin_aws_lambda 

Source
Expand description

Run an Autumn application on AWS Lambda.

Add the plugin. Do not change the call to run():

use autumn_plugin_aws_lambda::AwsLambdaPlugin;
use autumn_web::prelude::*;

#[get("/")]
async fn index() -> &'static str {
    "hello"
}

#[autumn_web::main]
async fn main() {
    autumn_web::app()
        .plugin(AwsLambdaPlugin::new())
        .routes(routes![index])
        .run()
        .await;
}

On Lambda, the plugin receives each event. It sends the event to the Autumn server as an HTTP request on loopback. With the default Activation::Auto, the plugin stays idle outside Lambda. See the design record.

Structs§

AwsLambdaPlugin
Runs an Autumn app on AWS Lambda.

Enums§

Activation
Controls when the plugin starts the Lambda runtime loop.
PluginError
Errors that stop the plugin at startup.
ResponseMode
How the plugin sends responses to Lambda.