{"id":15440847,"url":"https://github.com/gresau/example-rocket-lamb-api","last_synced_at":"2025-10-11T11:30:22.513Z","repository":{"id":45372184,"uuid":"199340295","full_name":"GREsau/example-rocket-lamb-api","owner":"GREsau","description":null,"archived":true,"fork":false,"pushed_at":"2020-11-22T06:35:06.000Z","size":21,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-06T18:49:46.307Z","etag":null,"topics":["api-gateway","lambda","rocket","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/GREsau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-28T21:46:44.000Z","updated_at":"2024-05-27T09:28:15.000Z","dependencies_parsed_at":"2022-09-17T08:11:50.985Z","dependency_job_id":null,"html_url":"https://github.com/GREsau/example-rocket-lamb-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GREsau/example-rocket-lamb-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GREsau%2Fexample-rocket-lamb-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GREsau%2Fexample-rocket-lamb-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GREsau%2Fexample-rocket-lamb-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GREsau%2Fexample-rocket-lamb-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GREsau","download_url":"https://codeload.github.com/GREsau/example-rocket-lamb-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GREsau%2Fexample-rocket-lamb-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279007031,"owners_count":26084227,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api-gateway","lambda","rocket","rust"],"created_at":"2024-10-01T19:15:33.925Z","updated_at":"2025-10-11T11:30:22.242Z","avatar_url":"https://github.com/GREsau.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 Example Rocket Lamb API 🐑\n\nA simple web API written using [Rocket](https://rocket.rs/), with two binaries:\n- `main`, a normal application which you can run locally for testing\n- `lambda`, written to be run as an AWS Lambda function, using [Rocket Lamb](https://github.com/GREsau/rocket-lamb)\n\nIt has two endpoints defined:\n- `/` (the root path) - returns `Hello world` as a plaintext response\n- `/rocket` - returns a PNG image\n\n## Deploying to AWS Lambda\nDeployment can be done using AWS CloudFormation using the [Serverless Application Model](https://docs.aws.amazon.com/lambda/latest/dg/serverless_app.html). The required CloudFormation template is already set up in [template.yaml](template.yaml).\n\nRequirements:\n- Docker\n- [AWS CLI](https://aws.amazon.com/cli/)\n- An existing S3 bucket\n\n```sh\n# Builds the lambda binary in a Docker container and outputs the packaged zip file\ndocker-compose run --rm build\n\nS3_BUCKET=my-s3-bucket-name\n# Choose any name you like for the CloudFormation stack\nSTACK_NAME=my-rocket-api\n\n# Uploads the CloudFormation template and zipped binary to S3\naws cloudformation package --template-file template.yaml --output-template-file packaged.yaml --s3-bucket $S3_BUCKET\n\n# Deploys the CloudFormation stack\naws cloudformation deploy --template-file packaged.yaml --capabilities CAPABILITY_IAM --stack-name $STACK_NAME\n\n# Outputs the API Gateway URL that you can use to call your API\naws cloudformation describe-stacks --query \"Stacks[0].Outputs\" --stack-name $STACK_NAME\n```\n\n## Testing Locally\nThe easiest way of running the application locally is just with `cargo run`, which will run [`main.rs`](src/bin/main.rs). This configures and launches a bog-standard Rocket server, without using Rocket Lamb.\n\nAnother way is to use the AWS [SAM CLI](https://github.com/awslabs/aws-sam-cli), which can be used to spin up a fake lambda environment in Docker with a mock API Gateway. While more of a hassle to run, this will also test both the CloudFormation configuration in template.yaml, and the application's integration with Lambda and API Gateway. To run the app using the SAM CLI:\n```sh\ndocker-compose run --rm build\n\nsam local start-api\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgresau%2Fexample-rocket-lamb-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgresau%2Fexample-rocket-lamb-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgresau%2Fexample-rocket-lamb-api/lists"}