{"id":18897493,"url":"https://github.com/curology/vicuna","last_synced_at":"2025-04-15T02:12:11.486Z","repository":{"id":52415183,"uuid":"227647411","full_name":"curology/vicuna","owner":"curology","description":"🦙 AWS Lambdas in Rust, made simple.","archived":false,"fork":false,"pushed_at":"2021-04-29T20:56:01.000Z","size":33,"stargazers_count":24,"open_issues_count":3,"forks_count":2,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-15T02:12:01.843Z","etag":null,"topics":["aws-lambdas","lambda","middleware","serverless","serverless-framework"],"latest_commit_sha":null,"homepage":"","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/curology.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-12-12T16:17:14.000Z","updated_at":"2025-02-23T11:25:47.000Z","dependencies_parsed_at":"2022-08-30T14:41:15.229Z","dependency_job_id":null,"html_url":"https://github.com/curology/vicuna","commit_stats":null,"previous_names":["pocketderm/vicuna"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curology%2Fvicuna","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curology%2Fvicuna/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curology%2Fvicuna/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curology%2Fvicuna/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/curology","download_url":"https://codeload.github.com/curology/vicuna/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248991558,"owners_count":21194894,"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-lambdas","lambda","middleware","serverless","serverless-framework"],"created_at":"2024-11-08T08:37:35.162Z","updated_at":"2025-04-15T02:12:11.449Z","avatar_url":"https://github.com/curology.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vicuna\n\n[![GitHub Actions](https://github.com/PocketDerm/vicuna/workflows/Rust/badge.svg)](https://github.com/PocketDerm/vicuna/actions) [![crates.io](http://meritbadge.herokuapp.com/vicuna)](https://crates.io/crates/vicuna) [![Released API docs](https://docs.rs/vicuna/badge.svg)](http://docs.rs/vicuna) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n\n\u003e AWS Lambdas in Rust made simple. \n\n- Simple, middleware-based interface\n- Naturally modular design\n- Purpose-built for [`serverless-rust`](https://www.npmjs.com/package/serverless-rust)\n\n\u003e ⚠️ **Active Development**: Vicuna's API has not stabalized and may change without warning between releases!\n\n## 📦 Install\n\nAdd the following to your `Cargo.toml` file.\n\n```toml\n[dependencies]\nvicuna = \"0.4.1\"\n```\n\n## 🤸 Usage\n\n\u003e 💡 This crate is intended to be paired with the [`serverless-rust`](https://www.npmjs.com/package/serverless-rust) plugin.\n\nVicuna produces handlers which take in a Lambda request and produce an\nappropriate response. The simplest handler is the `default_handler` provided by\nthe crate:\n\n```rust\nuse vicuna::{default_handler, lambda_http::lambda};\n\nfn main() {\n    lambda!(default_handler())\n}\n```\n\nHandlers can be composed from middleware which can handle the request-response\nlifecycle in an arbitrary fashion. For example, custom middleware can be\nwritten like so:\n\n```rust\nuse vicuna::Handler;\n\nfn my_middleware(handler: Handler) -\u003e Handler {\n    Box::new(move |request, context| {\n        // Resolve upstream middleware chain into a response...\n        let mut response = handler(request, context);\n        // ...mutate response as desired.\n        response\n    })\n}\n```\n\nMiddleware are wrapped around handlers, which themselves produce a handler for\nchainable invocation:\n\n```rust\nuse vicuna::lambda_http::lambda;\nuse vicuna::middleware::{body, header};\nuse vicuna::{default_handler, error, Handler, WrappingHandler};\n\nfn main() {\n    lambda!(default_handler::\u003cerror::Error\u003e()\n        .wrap_with(body(\"Hello, world!\"))\n        .wrap_with(header(\"x-foo\", \"bar\"))\n        .handler())\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurology%2Fvicuna","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcurology%2Fvicuna","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurology%2Fvicuna/lists"}