pub fn app_runtime(app: App) -> LambdaAppService
Expand description
Wraps an App
in a runtime environment compatible with AWS Lambda.
This function sets up a [LambdaAppService
] to process events in an AWS Lambda runtime,
using the provided App
instance. It simplifies the integration of applications with Lambda
by providing a service that manages incoming requests and outgoing responses.
§Parameters
app
: An instance ofApp
that represents the application to be run in the Lambda environment.
§Returns
A [LambdaAppService
] that can process incoming Lambda events using the provided application.
§Examples
use titan::App;
#[tokio::main]
async fn main() {
let app = App::default(); // Empty app example
// Uncomment last line to run this example
titan_lambda::app_runtime(app).run(); // .await.unwrap();
}
§See Also
App
: For implementing the application logic.- [
LambdaAppService
]: For the service that integrates with AWS Lambda.
§Errors
Any errors encountered during the processing of requests are handled and propagated
by the [LambdaAppService
].