Function trillium_aws_lambda::run

source ·
pub fn run(handler: impl Handler)
Expand description

Runs a trillium handler in a sync context

This function creates a new tokio runtime and executes the handler on it for aws lambda.

This function will block the current thread until the server shuts down

Examples found in repository?
examples/aws-lambda.rs (line 2)
1
2
3
fn main() {
    trillium_aws_lambda::run(|conn: trillium::Conn| async move { conn.ok("hello!") });
}