{"id":13742492,"url":"https://github.com/xvxx/vial","last_synced_at":"2025-12-16T10:55:55.523Z","repository":{"id":41944249,"uuid":"264597804","full_name":"xvxx/vial","owner":"xvxx","description":"🧪 a micro micro-framework for rust","archived":false,"fork":false,"pushed_at":"2023-09-04T15:02:45.000Z","size":2934,"stargazers_count":207,"open_issues_count":2,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-25T08:12:51.670Z","etag":null,"topics":["http","micro-framework","vial","web"],"latest_commit_sha":null,"homepage":"http://vial.rs","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/xvxx.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}},"created_at":"2020-05-17T06:20:35.000Z","updated_at":"2025-07-13T19:47:21.000Z","dependencies_parsed_at":"2024-01-15T00:06:08.324Z","dependency_job_id":"6b4bea34-66e9-4275-b2fe-87394236734c","html_url":"https://github.com/xvxx/vial","commit_stats":{"total_commits":407,"total_committers":12,"mean_commits":"33.916666666666664","dds":0.04668304668304668,"last_synced_commit":"120907e937323b52fb997724ad70a4cfc9326a87"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/xvxx/vial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvxx%2Fvial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvxx%2Fvial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvxx%2Fvial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvxx%2Fvial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xvxx","download_url":"https://codeload.github.com/xvxx/vial/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvxx%2Fvial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27763243,"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-12-16T02:00:10.477Z","response_time":57,"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":["http","micro-framework","vial","web"],"created_at":"2024-08-03T05:00:32.911Z","updated_at":"2025-12-16T10:55:55.504Z","avatar_url":"https://github.com/xvxx.png","language":"Rust","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"\u003cimg src=\"./docs/img/drink-me.jpeg\" alt=\"Drink Me.\" align=\"left\" height=\"300\" /\u003e\n\n# ~ vial: a micro micro-framework ~\n\n**Vial** is a small web \"framework\" for making small web sites in\nRust.\n\nIt includes just a few basics:\n\n- Parsing and routing HTTP requests\n- Parsing POST form data\n- Serving static files (css, js)\n\nEverything else... well, that's up to you.\n\nThe goal is an as-few-as-possible-dependencies web library you can\nuse to test out an idea quickly or get a personal project _rolling_.\nSingle file, server side apps? You bet! Fast compilation? Yes please!\n_À la carte_ dependencies? Now you're talkin'!\n\nIt's sort of like a picnic where the playlist is all 90s music and you\nhave to bring your own beverages. And food.\n\nTo learn more, keep reading or visit one of these links:\n\n- [Documentation](https://vial.rs/)\n- [API Reference](https://docs.rs/vial)\n- [Source Code](https://github.com/xvxx/vial)\n- [Examples](https://github.com/xvxx/vial/tree/master/examples)\n\n---\n\n**⚠ Status:** Vial is still in development and shouldn't be used to\nbuild real world apps on untrusted networks. Please proceed with caution\nand wear a hard hat at all times.\n\n---\n\n## ~ getting started ~\n\nTo get started, just add `vial` to your `Cargo.toml`:\n\n```toml\n[dependencies]\nvial = \"0.1\"\n```\n\nNow you can `use vial::prelude::*;` in your application to pull in the\ncommon types, or just use the crate like any other.\n\n## ~ hello world ~\n\nAs is tradition:\n\n```rust\nvial::routes! {\n    GET \"/\" =\u003e |_| \"Hello, world!\";\n}\n\nfn main() {\n    vial::run!().unwrap();\n}\n```\n\nFor a bit more sanity, you can route to functions directly:\n\n```rust\nuse vial::prelude::*;\n\nroutes! {\n    GET \"/echo\" =\u003e echo;\n    POST \"/echo\" =\u003e post;\n}\n\nfn echo(_: Request) -\u003e \u0026'static str {\n    \"\u003cform method='POST'\u003e\n        \u003cinput type='text' name='echo'/\u003e\n        \u003cinput type='submit'/\u003e\n    \u003c/form\u003e\"\n}\n\nfn post(req: Request) -\u003e String {\n    format!(\n        \"\u003ch1\u003eYou said: {}\u003c/h1\u003e\",\n        req.form(\"echo\").unwrap_or(\"You didn't say anything!\")\n    )\n}\n\nfn main() {\n    vial::run!().unwrap();\n}\n```\n\nTo _really_ break the mold, you can split your site into different\nmodules:\n\n```rust\nuse vial;\n\nmod wiki;\nmod blog;\n\nmod index {\n    use vial::prelude::*;\n    routes! {\n        GET \"/\" =\u003e |_| Response::from_file(\"index.html\")\n    }\n}\n\nfn main() {\n    // The order matters here - if `wiki` and `blog` both define \"/\",\n    // the `mod index` version will match first and get run.\n    vial::run!(index, wiki, blog);\n}\n```\n\nBut hey, who wants to putz around with HTML when you can be writing\n**Rust**? Enable the `horror` feature and you're on your way:\n\n```rust\nuse vial::prelude::*;\n\n#[macro_use]\nextern crate horrorshow;\n\nroutes! {\n    GET \"/\" =\u003e |_| html! {\n        p {\n            : \"You're looking for this: \";\n            a(href=\"/echo\") { : \"echo\" }\n        }\n    };\n    GET \"/echo\" =\u003e echo;\n    POST \"/echo\" =\u003e post;\n}\n\nfn echo(_: Request) -\u003e impl Responder {\n    html! {\n        form(method=\"POST\") {\n            p {\n            : \"Type something: \";\n                input(type=\"text\", name=\"echo\");\n                input(type=\"submit\");\n            }\n        }\n    }\n}\n\nfn post(req: Request) -\u003e impl Responder {\n    owned_html! {\n        h1: req.form(\"echo\")\n            .unwrap_or(\"You didn't say anything!\");\n    }\n}\n\nfn main() {\n    vial::run!().unwrap();\n}\n```\n\n## ~ bonus features ~\n\n**vial** doesn't come with JSON or a template engine or any of that\nfancy stuff by default, but there (will be) a few compile-time\n`--features` you can activate for enhanced productivity:\n\n\u003cimg src=\"./docs/img/alice.jpeg\" alt=\"Alice\" align=\"right\" width=\"250\" /\u003e\n\n- [x] **hatter**: Enable [Hatter]: A positively mad, HTML templating\n      language.\n- [x] **horror**: Enable [horrorshow]: A small \u0026 fast macro-based HTML\n      builder.\n- [x] **json_serde**: `Request::json` and `Response::with_json` powers, via\n      Serde.\n- [x] **json_nano**: `Request::json` and `Response::with_json`, via\n      nanoserde.\n- [x] **cookies**: `Request::cookie()`, `Response::with_cookie`, and\n      friends.\n- [x] **sessions**: `Request::session()`, `Response::with_session`, and\n      friends.\n- [ ] **uploads**: Multipart form data (file uploads)\n- [ ] **log**: Access logging\n\n_**Please note:** The list above is a work-in-progress._\n\n## ~ hot reloading ~\n\nYour assets will automatically get reloaded in debug mode, complete\nwith proper ETag support, but you probably want to refresh your Rust\ncode, too.\n\nRight now the easiest way is to use [cargo-watch]:\n\n    $ cargo install cargo-watch\n    $ cargo watch -x 'run --example hello_world'\n\n## ~ testing ~\n\nTests can be run on a recent version of stable **Rust** with\n`make test`. We also run tests on commits with [GitHub\nActions][gh-build-action].\n\n**Vial** prefers to put everything in `tests/` rather than include\ntests directly in `src/*.rs` files. To access private APIs in tests,\nwe make them `pub` and use `#[doc(hidden)]`. Your cooperation is\nappreciated.\n\n## ~ license ~\n\n**Vial** is licensed under either of the following, at your option:\n\n- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or\n  http://www.apache.org/licenses/LICENSE-2.0)\n- MIT License ([LICENSE-MIT](LICENSE-MIT) or\n  http://opensource.org/licenses/MIT)\n\n[cargo-watch]: https://crates.io/crates/cargo-watch\n[horrorshow]: https://github.com/Stebalien/horrorshow-rs\n[hatter]: https://github.com/xvxx/hatter\n[gh-build-action]: https://github.com/xvxx/vial/actions?query=workflow%3Abuild\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxvxx%2Fvial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxvxx%2Fvial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxvxx%2Fvial/lists"}