{"id":20757190,"url":"https://github.com/vapor-community/vapor-aws-lambda-runtime","last_synced_at":"2025-04-28T20:57:53.260Z","repository":{"id":49038824,"uuid":"230949425","full_name":"vapor-community/vapor-aws-lambda-runtime","owner":"vapor-community","description":"Run your Vapor api server on AWS Lambda using the official Swift Server runtime.","archived":false,"fork":false,"pushed_at":"2021-10-23T19:32:37.000Z","size":50,"stargazers_count":105,"open_issues_count":5,"forks_count":12,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-28T20:57:48.315Z","etag":null,"topics":["aws","aws-lambda","aws-lambda-swift","lambda","swift","swift-server","vapor"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vapor-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-30T16:49:45.000Z","updated_at":"2025-02-23T16:12:36.000Z","dependencies_parsed_at":"2022-07-26T06:02:00.741Z","dependency_job_id":null,"html_url":"https://github.com/vapor-community/vapor-aws-lambda-runtime","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vapor-community%2Fvapor-aws-lambda-runtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vapor-community%2Fvapor-aws-lambda-runtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vapor-community%2Fvapor-aws-lambda-runtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vapor-community%2Fvapor-aws-lambda-runtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vapor-community","download_url":"https://codeload.github.com/vapor-community/vapor-aws-lambda-runtime/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251389338,"owners_count":21581778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","aws-lambda-swift","lambda","swift","swift-server","vapor"],"created_at":"2024-11-17T09:40:26.303Z","updated_at":"2025-04-28T20:57:53.244Z","avatar_url":"https://github.com/vapor-community.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vapor-aws-lambda-runtime\n\n\n[![Swift 5.2](https://img.shields.io/badge/Swift-5.2-blue.svg)](https://swift.org/download/)\n[![Vapor 4](https://img.shields.io/badge/Vapor-4-5AA9E7.svg)](/vapor/vapor)\n[![github-actions](https://github.com/fabianfett/vapor-lambda-runtime/workflows/CI/badge.svg)](https://github.com/fabianfett/vapor-lambda-runtime/actions)\n[![codecov](https://codecov.io/gh/fabianfett/vapor-lambda-runtime/branch/main/graph/badge.svg)](https://codecov.io/gh/fabianfett/vapor-lambda-runtime)\n\nRun your Vapor app on AWS Lambda. This package bridges the communication between [`swift-aws-lambda-runtime`](https://github.com/swift-server/swift-aws-lambda-runtime)\nand the [Vapor](https://github.com/vapor/vapor) framework. APIGateway requests are transformed into `Vapor.Request`s and `Vapor.Response`s are written back to the APIGateway. It intents to bring the funcionality of [`aws-lambda-go-api-proxy`](/awslabs/aws-lambda-go-api-proxy) to Vapor.\n\n## Status\n\n**Note: Currently this is nothing more than a proof of concept. Use at your own risk. I would like to hear feedback, if you played with this. Please open a GitHub issues for all open ends, you experience.**\n\nWhat I have tested:\n\n- [x] Routing\n- [x] JSON Coding\n- [ ] Cors Middleware\n- [ ] Fluent\n\nThere are probably tons of other things that we should test. I haven't done much with Vapor so far. Therefore you will need to help me list the things to test.\n\nExamples:\n\n- [HelloWorld](examples/Hello/Sources/Hello/main.swift)\n\nIf you test anything, please open a PR so that we can document the state of affairs better. A super small example would be even better. I plan to create some integration tests with the examples.\n\n## Usage\n\nAdd `vapor-aws-lambda-runtime` and `vapor` as dependencies to your project. For this open your `Package.swift`:\n\n```swift\n  dependencies: [\n    .package(url: \"https://github.com/vapor/vapor.git\", .upToNextMajor(from: \"4.0.0\")),\n    .package(url: \"https://github.com/fabianfett/vapor-aws-lambda-runtime\", .upToNextMajor(from: \"0.4.0\")),\n  ]\n```\n\nAdd VaporLambdaRuntime as depency to your target:\n\n```swift\n  targets: [\n    .target(name: \"Hello\", dependencies: [\n      .product(name: \"Vapor\", package: \"vapor\"),\n      .product(name: \"VaporAWSLambdaRuntime\", package: \"vapor-aws-lambda-runtime\")\n    ]),\n  ]\n```\n\nCreate a simple Vapor app.\n\n```swift\nimport Vapor\nimport VaporAWSLambdaRuntime\n\nlet app = Application()\n\nstruct Name: Codable {\n  let name: String\n}\n\nstruct Hello: Content {\n  let hello: String\n}\n\napp.get(\"hello\") { (_) -\u003e Hello in\n  Hello(hello: \"world\")\n}\n\napp.post(\"hello\") { req -\u003e Hello in\n  let name = try req.content.decode(Name.self)\n  return Hello(hello: name.name)\n}\n```\n\nNext we just need to run the vapor app. To enable running in Lambda, we need to change the \"serve\" command. Then we can start the app by calling `app.run()`\n\n```swift\napp.servers.use(.lambda)\n\ntry app.run()\n```\n\n## Contributing\n\nPlease feel welcome and encouraged to contribute to vapor-aws-lambda-runtime. The current version has a long way to go before being ready for production use and help is always welcome.\n\nIf you've found a bug, have a suggestion or need help getting started, please open an Issue or a PR. If you use this package, I'd be grateful for sharing your experience.\n\nIf you like this project, I'm excited about GitHub stars. 🤓\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvapor-community%2Fvapor-aws-lambda-runtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvapor-community%2Fvapor-aws-lambda-runtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvapor-community%2Fvapor-aws-lambda-runtime/lists"}