{"id":16189944,"url":"https://github.com/brson/basic-http-server","last_synced_at":"2025-04-08T16:08:22.786Z","repository":{"id":3528539,"uuid":"49865240","full_name":"brson/basic-http-server","owner":"brson","description":"A simple static HTTP server in Rust, for learning and local doc development","archived":false,"fork":false,"pushed_at":"2023-12-10T06:15:50.000Z","size":289,"stargazers_count":384,"open_issues_count":16,"forks_count":53,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-01T14:17:01.671Z","etag":null,"topics":[],"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/brson.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}},"created_at":"2016-01-18T09:13:18.000Z","updated_at":"2025-03-20T07:39:06.000Z","dependencies_parsed_at":"2023-12-10T07:22:48.905Z","dependency_job_id":"4468bb19-c900-4fd7-b72f-29055b908175","html_url":"https://github.com/brson/basic-http-server","commit_stats":{"total_commits":161,"total_committers":10,"mean_commits":16.1,"dds":"0.15527950310559002","last_synced_commit":"575dc91276ebaf0e3f9dce835a4a46bad034f296"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brson%2Fbasic-http-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brson%2Fbasic-http-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brson%2Fbasic-http-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brson%2Fbasic-http-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brson","download_url":"https://codeload.github.com/brson/basic-http-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247878022,"owners_count":21011158,"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":[],"created_at":"2024-10-10T07:37:35.231Z","updated_at":"2025-04-08T16:08:22.767Z","avatar_url":"https://github.com/brson.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `basic-http-server`\n\nA simple static HTTP server, for learning and local development.\n\n`basic-http-server` is designed for two purposes:\n\n- _as a teaching tool_. It is a simple and well-commented example of\n  basic [`tokio`], [`hyper`], and asynchronous Rust programming,\n  with `async` / `await`.\n\n- _for local development_. It serves static HTML content, and with the `-x`\n   flag, provides convenience features useful for creating developer\n   documentation, including markdown rendering and directory listing.\n \nThe entire reference source for setting up a `hyper` HTTP server is contained in\n[`main.rs`]. The [`ext.rs`] file contains developer extensions.\n\n[`tokio`]: https://github.com/tokio-rs/tokio\n[`hyper`]: https://github.com/hyperium/hyper\n[`main.rs`]: src/main.rs\n[`ext.rs`]: src/ext.rs\n\n\n## Developer extensions\n\nWhen passed the `-x` flag, `basic-http-server` enables additional conveniences\nuseful for developing documentation locally. Those extensions are:\n\n- Rendering files with the \".md\" extension as Markdown.\n\n- Listing directories when no \"index.html\" file is found.\n\n- Serving common source code files as \"text/plain\" so they are\n  rendered in the browser.\n\nThis makes `basic-http-server` useful for the following scenarios:\n\n- Previewing markdown content. Draft your `README.md` changes and view them\n  locally before pushing to GitHub.\n\n- Navigating to local documentation, including Rust API documentation. Just run\n  `basic-http-server -x` in your project directory, and use the directory\n  listing to navigate to `target/doc`, then find the crates to read from there\n  (`cargo doc` doesn't put an `index.html` file in `target/doc`).\n\n\n## Installation and Use\n\n**Note that `basic-http-server` is not production-ready and should not be\nexposed to the internet. It is a learning and development tool.**\n\nInstall with `cargo install`:\n\n```sh\n$ cargo install basic-http-server\n$ basic-http-server\n```\n\nTo turn on the developer extensions, pass `-x`:\n\n```sh\n$ basic-http-server -x\n```\n\nTo increase logging verbosity use `RUST_LOG`:\n\n```sh\nRUST_LOG=basic_http_server=trace basic-http-server -x\n```\n\nCommand line arguments:\n\n```\nUSAGE:\n        basic-http-server [FLAGS] [OPTIONS] [ARGS]\n\nFLAGS:\n    -x               Enable developer extensions\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -a, --addr \u003cADDR\u003e    Sets the IP:PORT combination (default \"127.0.0.1:4000\")\n\nARGS:\n    ROOT    Sets the root directory (default \".\")\n\n```\n\n\n## License\n\nMIT/Apache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrson%2Fbasic-http-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrson%2Fbasic-http-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrson%2Fbasic-http-server/lists"}