{"id":21991928,"url":"https://github.com/elct9620/hanami-lambda","last_synced_at":"2025-04-30T14:19:29.796Z","repository":{"id":214930573,"uuid":"737718877","full_name":"elct9620/hanami-lambda","owner":"elct9620","description":"Hanami Lambda is a gem that provides a way to run hanami application on AWS Lambda.","archived":false,"fork":false,"pushed_at":"2025-01-23T07:06:16.000Z","size":90,"stargazers_count":4,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-30T14:18:51.786Z","etag":null,"topics":["hanami","lambda"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elct9620.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-01T08:09:03.000Z","updated_at":"2025-01-23T07:06:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"0d6feec1-56cf-497d-ba37-2a248a81b536","html_url":"https://github.com/elct9620/hanami-lambda","commit_stats":null,"previous_names":["elct9620/hanami-lambda"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elct9620%2Fhanami-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elct9620%2Fhanami-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elct9620%2Fhanami-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elct9620%2Fhanami-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elct9620","download_url":"https://codeload.github.com/elct9620/hanami-lambda/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251720908,"owners_count":21632735,"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":["hanami","lambda"],"created_at":"2024-11-29T20:12:11.534Z","updated_at":"2025-04-30T14:19:29.762Z","avatar_url":"https://github.com/elct9620.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Hanami::Lambda\n===\n\nHanami Lambda is a gem that provides a way to run hanami application on AWS Lambda.\n\n## Status\n\n[![Gem Version](https://badge.fury.io/rb/hanami-lambda.svg)](https://badge.fury.io/rb/hanami-lambda)\n[![CI](https://github.com/elct9620/hanami-lambda/actions/workflows/main.yml/badge.svg)](https://github.com/elct9620/hanami-lambda/actions/workflows/main.yml)\n\n## Rubies\n\n**Hanami::Lambda** supports Ruby (MRI) 3.0+\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"hanami-lambda\"\n```\n\nAnd then execute:\n\n```\n$ bundle install\n```\n\nUpdate `config/app.rb` with below content\n\n```ruby\nrequire 'hanami'\nrequire 'hanami/lambda'\n\nmodule MyApp # Rename to your app name\n  class Lambda \u003c Hanami::App\n    extend Hanami::Lambda::Application\n  end\nend\n```\n\nCreate `app/function.rb` as handler base class\n\n```ruby\nmodule MyApp\n  class Function \u003c Hanami::Lambda::Function\n  end\nend\n```\n\n\u003e Generator is comming soon.\n\n## Usage\n\nUse `config/app.Hanami::Lambda.call` as the function handler\n\n```yaml\n# AWS SAM\nResources:\n  MyFunction:\n    Type: AWS::Serverless::Function\n    Properties:\n      CodeUri: .\n      Handler: config/app.Hanami::Lambda.call\n      Runtime: ruby3.2\n```\n\n### Delegate\n\nIf the lambda function isn't trigger by APIGateway, we can use `delegate` method to define the handler function.\n\nCreate `config/lambda.rb` with below content\n\n```ruby\nmodule MyApp\n  class Lambda \u003c Hanami::Lambda::Dispatcher\n    delegate \"MyFunction\", to: \"daily_task\"\n  end\nend\n```\n\n\u003e The IaC generated function will be `my-app-MyFunction-r8faNAo3iUqx` therefore the dispatcher will use include `MyFunction` to find targeted function\n\nAdd `app/functions/daily_task.rb` to define the handle action\n\n```ruby\nmodule MyApp\n  module Functions\n    class DailyTask \u003c MyApp::Function\n      def handle(event, context)\n        # ...\n      end\n    end\n  end\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/elct9620/hanami-lambda.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felct9620%2Fhanami-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felct9620%2Fhanami-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felct9620%2Fhanami-lambda/lists"}