{"id":19366197,"url":"https://github.com/pepoviola/tide-lambda-listener-example","last_synced_at":"2026-04-11T20:45:19.249Z","repository":{"id":141151363,"uuid":"374672023","full_name":"pepoviola/tide-lambda-listener-example","owner":"pepoviola","description":"Lambda example app using Tide framework ","archived":false,"fork":false,"pushed_at":"2021-06-09T00:50:50.000Z","size":23,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-06T21:30:55.833Z","etag":null,"topics":["aws","aws-lambda","rust","serverless","sqlx","tide"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pepoviola.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-06-07T13:15:57.000Z","updated_at":"2025-01-03T11:18:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"92d7f6a6-6ee6-4a4b-b1a3-4a235fded029","html_url":"https://github.com/pepoviola/tide-lambda-listener-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepoviola%2Ftide-lambda-listener-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepoviola%2Ftide-lambda-listener-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepoviola%2Ftide-lambda-listener-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepoviola%2Ftide-lambda-listener-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pepoviola","download_url":"https://codeload.github.com/pepoviola/tide-lambda-listener-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240484631,"owners_count":19808823,"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","rust","serverless","sqlx","tide"],"created_at":"2024-11-10T07:43:32.843Z","updated_at":"2026-04-11T20:45:14.213Z","avatar_url":"https://github.com/pepoviola.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tide Lambda listener example\n\nA little example serverless application, that you can deploy with the [sam cli](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html), using Rust as a custom runtime and building with [Tide](https://github.com/http-rs/tide) and [tide-lambda-listener](https://github.com/Fishrock123/tide-lambda-listener) and using a PostgreSQL database to store the `greetings`.\n\nYou check this [post](https://towardsdatascience.com/setting-up-a-postgresql-instance-on-the-cloud-4ec4cf168239) for a nice list of `free-tier` offerings for a pg db.\n\ndb schema:\n```sql\nCREATE TABLE \"public\".\"tide-lambda-example-greetings\" (\n    \"name\" text NOT NULL,\n    \"created_at\" timestamp with time zone,\n    \"modified_at\" timestamp with time zone,\n    PRIMARY KEY (\"name\")\n);\n```\n\nTo build and deploy your application for the first time, you will need first to complete the `DB_URL` in the `template.yml` file with your database url and then run the following in your shell:\n\n```bash\nsam build\nsam deploy --guided\n```\n\nThis will deploy two lambda functions:\n\n#### PostHello\n\nSave your greeting into the db\n\n```bash\n    $ curl -X POST -d '{\"name\":\"joe\"}'  https://\u003cid\u003e.execute-api.us-east-2.amazonaws.com/Prod/hello\n\n    Hello joe, welcome to this tide lambda example.\n```\n\n\n\n#### GettHello\n\nRetrive your greeting\n\n```bash\ncurl  https://\u003cid\u003e.execute-api.us-east-2.amazonaws.com/Prod/hello/joe\nHi again joe\n```\n\n### Custom build\n\nSAM allow us to build each funcntion using a `makefile`, we are using this file to file also to set the `file` to use in our `build.rs` file allowing to **only** compile the needed function endpoint and inject it into the `main` function of our application.\n\n*This is an exploration and could be more efficient ways to conditional compile the code.*\n\n### Compile to AWS lambda\n\nYou will need to target `x86_64-unknown-linux-musl`, you can check this [article](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/building-custom-runtimes.html) about custom runtimes.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepoviola%2Ftide-lambda-listener-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpepoviola%2Ftide-lambda-listener-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepoviola%2Ftide-lambda-listener-example/lists"}