{"id":15648899,"url":"https://github.com/djc/mendes","last_synced_at":"2025-03-17T15:12:34.823Z","repository":{"id":35161357,"uuid":"215384518","full_name":"djc/mendes","owner":"djc","description":"Rust web toolkit for impatient perfectionists","archived":false,"fork":false,"pushed_at":"2024-04-22T07:17:55.000Z","size":366,"stargazers_count":41,"open_issues_count":3,"forks_count":9,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-05-02T05:01:56.606Z","etag":null,"topics":["async","rust","web"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/djc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","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},"funding":{"github":["djc"],"patreon":"dochtman"}},"created_at":"2019-10-15T19:52:47.000Z","updated_at":"2024-07-12T09:03:47.016Z","dependencies_parsed_at":"2023-12-04T15:25:38.812Z","dependency_job_id":"87e0eadb-10d9-42cf-b578-5390ac58a440","html_url":"https://github.com/djc/mendes","commit_stats":{"total_commits":393,"total_committers":6,"mean_commits":65.5,"dds":"0.022900763358778664","last_synced_commit":"94481bc5e211cd363a265764550e676f93846fdc"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djc%2Fmendes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djc%2Fmendes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djc%2Fmendes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djc%2Fmendes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/djc","download_url":"https://codeload.github.com/djc/mendes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244056425,"owners_count":20390719,"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":["async","rust","web"],"created_at":"2024-10-03T12:26:58.300Z","updated_at":"2025-03-17T15:12:34.802Z","avatar_url":"https://github.com/djc.png","language":"Rust","funding_links":["https://github.com/sponsors/djc","https://patreon.com/dochtman"],"categories":[],"sub_categories":[],"readme":"# Mendes: web toolkit for impatient perfectionists\n\n[![Documentation](https://docs.rs/mendes/badge.svg)](https://docs.rs/mendes/)\n[![Crates.io](https://img.shields.io/crates/v/mendes.svg)](https://crates.io/crates/mendes)\n[![Build status](https://github.com/djc/mendes/workflows/CI/badge.svg)](https://github.com/djc/mendes/actions?query=workflow%3ACI)\n[![Coverage status](https://codecov.io/gh/djc/mendes/branch/master/graph/badge.svg)](https://codecov.io/gh/djc/mendes)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE-MIT)\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE-APACHE)\n\nMendes is a Rust web toolkit for impatient perfectionists (apologies to Django).\nIt aims to be:\n\n* Modular: less framework, more library; pick and choose components\n* Async: async/await from the start\n* Low boilerplate: easy to get started, but with limited \"magic\"\n* Type-safe: leverage the type system to make error handling low effort\n* Secure: provide security by default; no unsafe code in this project\n* Run on stable Rust (no promises on MSRV though)\n\nMendes is currently in an extremely early phase and probably not ready for anything\nbut experiments for those who are curious. Feedback is always welcome though!\n\n## Minimal example\n\nThis should definitely become more minimal over time.\n\n```rust\nuse async_trait::async_trait;\nuse hyper::Body;\nuse mendes::application::IntoResponse;\nuse mendes::http::request::Parts;\nuse mendes::http::{Response, StatusCode};\nuse mendes::{handler, route, Application, Context};\n\n#[handler(GET)]\nasync fn hello(_: \u0026App) -\u003e Result\u003cResponse\u003cBody\u003e, Error\u003e {\n    Ok(Response::builder()\n        .status(StatusCode::OK)\n        .body(\"Hello, world\".into())\n        .unwrap())\n}\n\nstruct App {}\n\n#[async_trait]\nimpl Application for App {\n    type RequestBody = ();\n    type ResponseBody = Body;\n    type Error = Error;\n\n    async fn handle(mut cx: Context\u003cSelf\u003e) -\u003e Response\u003cBody\u003e {\n        route!(match cx.path() {\n            _ =\u003e hello,\n        })\n    }\n}\n\n#[derive(Debug)]\nenum Error {\n    Mendes(mendes::Error),\n}\n\nimpl From\u003cmendes::Error\u003e for Error {\n    fn from(e: mendes::Error) -\u003e Self {\n        Error::Mendes(e)\n    }\n}\n\nimpl From\u003c\u0026Error\u003e for StatusCode {\n    fn from(e: \u0026Error) -\u003e StatusCode {\n        let Error::Mendes(e) = e;\n        StatusCode::from(e)\n    }\n}\n\nimpl IntoResponse\u003cApp\u003e for Error {\n    fn into_response(self, _: \u0026App, _: \u0026Parts) -\u003e Response\u003cBody\u003e {\n        let Error::Mendes(err) = self;\n        Response::builder()\n            .status(StatusCode::from(\u0026err))\n            .body(err.to_string().into())\n            .unwrap()\n    }\n}\n```\n\nAll feedback welcome. Feel free to file bugs, requests for documentation and\nany other feedback to the [issue tracker][issues].\n\nMendes was created and is maintained by Dirkjan Ochtman.\n\n[issues]: https://github.com/djc/mendes/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjc%2Fmendes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdjc%2Fmendes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjc%2Fmendes/lists"}