Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kanarus
Copy link
Member

@kanarus kanarus commented Feb 3, 2025

Add experimental support for AWS Lambda!

#[tokio::main]
async fn main() -> Result<(), lambda_runtime::Error> {
    // set up an ordinary Ohkami
    let o: Ohkami = ...;

    // just pass it to `lambda_runtime::run`
    lambda_runtime::run(o).await
}

Both Function URLs and API Gateway are supported, but WebSocket ( ws feature ) is not support now ( due to the drastically specialized way of API Gateway's WebSocket API ).

Achieved by conversions

  • LambdaEvent -> ohkami::Request
  • ohkami::Response -> FunctionResponse

and trait impl

  • Service for Ohkami

This includes bugfix around query parameters handling.

github-actions[bot]
github-actions bot previously approved these changes Feb 3, 2025
github-actions[bot]
github-actions bot previously approved these changes Feb 3, 2025
github-actions[bot]
github-actions bot previously approved these changes Feb 3, 2025
github-actions[bot]
github-actions bot previously approved these changes Feb 3, 2025
@kanarus kanarus linked an issue Feb 3, 2025 that may be closed by this pull request
@kanarus kanarus merged commit 58ce81b into v0.22 Feb 3, 2025
3 checks passed
@kanarus kanarus deleted the feat/rt_lambda branch February 3, 2025 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support AWS Lambda

1 participant