{"id":13440249,"url":"https://github.com/tomaka/rouille","last_synced_at":"2025-05-14T06:13:44.230Z","repository":{"id":35033971,"uuid":"39148240","full_name":"tomaka/rouille","owner":"tomaka","description":"Web framework in Rust","archived":false,"fork":false,"pushed_at":"2024-07-31T14:58:46.000Z","size":4406,"stargazers_count":1165,"open_issues_count":59,"forks_count":107,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-04-11T00:51:23.118Z","etag":null,"topics":["http","rust","server","web"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"scdoshi/django-notifier","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomaka.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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}},"created_at":"2015-07-15T16:34:41.000Z","updated_at":"2025-03-31T14:10:49.000Z","dependencies_parsed_at":"2024-06-10T17:42:27.776Z","dependency_job_id":"6a0806ec-216c-4de4-be50-37170bbe8066","html_url":"https://github.com/tomaka/rouille","commit_stats":{"total_commits":350,"total_committers":51,"mean_commits":6.862745098039215,"dds":"0.39142857142857146","last_synced_commit":"ea70dcc90eeccac3328ae3adf6e0b3824a88ea0f"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaka%2Frouille","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaka%2Frouille/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaka%2Frouille/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaka%2Frouille/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomaka","download_url":"https://codeload.github.com/tomaka/rouille/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254083590,"owners_count":22011901,"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":["http","rust","server","web"],"created_at":"2024-07-31T03:01:21.060Z","updated_at":"2025-05-14T06:13:44.208Z","avatar_url":"https://github.com/tomaka.png","language":"Rust","readme":"# Rouille, a Rust web micro-framework\n\nRouille is a micro-web-framework library. It creates a listening socket and parses incoming HTTP\nrequests from clients, then gives you the hand to process the request.\n\nRouille was designed to be intuitive to use if you know Rust. Contrary to express-like frameworks,\nit doesn't employ middlewares. Instead everything is handled in a linear way.\n\nConcepts closely related to websites (like cookies, CGI, form input, etc.) are directly supported\nby rouille. More general concepts (like database handling or templating) are not directly handled,\nas they are considered orthogonal to the micro web framework. However rouille's design makes it easy\nto use in conjunction with any third-party library without the need for any glue code.\n\n## [Documentation](https://docs.rs/rouille)\n\n[![](https://docs.rs/rouille/badge.svg)](https://docs.rs/rouille)\n\n## Getting started\n\nIf you have general knowledge about how HTTP works, [the documentation](https://docs.rs/rouille)\nand [the well-documented examples](https://github.com/tomaka/rouille/tree/master/examples) are\ngood resources to get you started.\n\n## License\n\nLicensed under either of\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you shall be dual licensed as above, without any\nadditional terms or conditions.\n\n## FAQ\n\n### What about performances?\n\nAsync I/O, green threads, coroutines, etc. in Rust are still very immature.\n\nThe rouille library just ignores this optimization and focuses on providing an easy-to-use\nsynchronous API instead, where each request is handled in its own dedicated thread.\n\nEven if rouille itself was asynchronous, you would need asynchronous database clients and\nasynchronous file loading in order to take advantage of it. There are currently no such libraries\nin the Rust ecosystem.\n\nOnce async I/O has been figured out, rouille will be (hopefully transparently) updated to take it\ninto account.\n\n### But is it fast?\n\nOn the author's old Linux machine, some basic benchmarking with `wrk -t 4 -c 4` shows the\nfollowing results:\n\n- The hello-world example of rouille yields ~22k requests/sec.\n- A hello world in nodejs (with `http.createServer`) yields ~14k requests/sec.\n- The hello-world example of [tokio-minihttp](https://github.com/tokio-rs/tokio-minihttp) (which is\n  supposedly the fastest HTTP server that currently exists) yields ~77k requests/sec. \n- The hello example of [hyper](https://github.com/hyperium/hyper) (which uses async I/O with mio\n  as well) yields ~53k requests/sec.\n- A hello world in Go yields ~51k requests/sec.\n- The default installation of nginx yields ~39k requests/sec.\n\nWhile not the fastest, rouille has *reasonable* performances. Amongst all these examples, rouille\nis the only one to use synchronous I/O.\n\n### Are there plugins for features such as database connection, templating, etc.\n\nIt should be trivial to integrate a database or templates to your web server written with\nrouille. Moreover plugins need maintenance and tend to create a dependency hell. In the author's\nopinion it is generally better not to use plugins.\n\n### But I'm used to express-like frameworks!\n\nInstead of doing this: (pseudo-code)\n\n```js\nserver.add_middleware(function() {\n    // middleware 1\n});\n\nserver.add_middleware(function() {\n    // middleware 2\n});\n\nserver.add_middleware(function() {\n    // middleware 3\n});\n```\n\nIn rouille you just handle each request entirely manually:\n\n```rust\n// initialize everything here\n\nrouille::start_server(..., move |request| {\n    // middleware 1\n\n    // middleware 2\n\n    // middleware 3\n});\n```\n","funding_links":[],"categories":["Libraries","库 Libraries","Rust","库","Web Framework"],"sub_categories":["Web programming","网络编程 Web programming","网页编程","web编程 Web programming"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomaka%2Frouille","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomaka%2Frouille","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomaka%2Frouille/lists"}