{"id":13502920,"url":"https://github.com/raphamorim/cargo-server","last_synced_at":"2026-04-08T14:32:38.946Z","repository":{"id":58064914,"uuid":"529848773","full_name":"raphamorim/cargo-server","owner":"raphamorim","description":"serve a static site, single page application or just a static file with Rust","archived":false,"fork":false,"pushed_at":"2023-11-12T00:02:27.000Z","size":852,"stargazers_count":28,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-12T15:01:17.083Z","etag":null,"topics":["file-server","rust-lang","server","simple-server","static-site"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/cargo-server","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raphamorim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["raphamorim"]}},"created_at":"2022-08-28T11:58:01.000Z","updated_at":"2026-01-03T04:17:37.000Z","dependencies_parsed_at":"2024-01-18T23:25:55.096Z","dependency_job_id":"122bea19-ffd3-4548-aaa7-3a7e444c80b9","html_url":"https://github.com/raphamorim/cargo-server","commit_stats":{"total_commits":37,"total_committers":1,"mean_commits":37.0,"dds":0.0,"last_synced_commit":"8036c0df443a182c00c7305965cda507d6177d3d"},"previous_names":["raphamorim/ou"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/raphamorim/cargo-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphamorim%2Fcargo-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphamorim%2Fcargo-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphamorim%2Fcargo-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphamorim%2Fcargo-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphamorim","download_url":"https://codeload.github.com/raphamorim/cargo-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphamorim%2Fcargo-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31559814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["file-server","rust-lang","server","simple-server","static-site"],"created_at":"2024-07-31T22:02:30.141Z","updated_at":"2026-04-08T14:32:38.920Z","avatar_url":"https://github.com/raphamorim.png","language":"Rust","readme":"# cargo-server\n\n\u003e tl;dr: Does the same as \"python -m http.server\" or \"npx serve\" but for Rust ecosystem and with few more functionalities.\n\n`cargo-server` helps you serve a static site, single page application or just a static file (no matter if on your device or on the local network). It also provides a neat interface for listing the directory's contents.\n\nYou can use cargo to install:\n\n```bash\ncargo install cargo-server\n```\n\nWith cargo-binstall:\n\n```bash\ncargo binstall cargo-server\n```\n\nOnce `cargo-server` is installed, you can run this command inside your project's directory. It will create by default in `8000` port:\n\n```bash\ncargo server\n```\n\n## --port\n\nTo specify the port, you can use `--port`:\n\n```bash\ncargo server --port 3000\n```\n\n## --open\n\nTo open in your browser after run the command just add `--open`:\n\n```bash\ncargo server --open\n```\n\n## --path\n\nYou can also set a custom path using `--path`:\n\n```bash\ncargo server --path ./examples/simple-wasm-frontend-app\n```\n\nResult:\n\n![Demo](resources/demo-file-server.png)\n\n## --quiet\n\nIs also possible to run without any stdout using `--quiet`:\n\n```bash\ncargo server --quiet --open --path ./examples/simple-wasm-frontend-app\n```\n\n## --route\n\nYou can create custom routes that returns JSON\n\n#### `--json` with params\n\n```bash\ncargo server \\\n\t--route '/users/:userId' \\\n\t--json '{\"data\":{\"userId\":\"{!0}\",\"givenName\":\"Raphael\",\"country\":\"br\"}}' \\\n\t--port 8123\n```\n\nResult:\n\n![Demo JSON with params](resources/demo-json-with-params.png)\n\n#### `--json` without params\n\n```bash\ncargo server \\\n\t--route '/users' \\\n\t--json '{\"users\":[{\"data\":{\"userId\":\"3\",\"givenName\":\"Raphael\",\"country\":\"br\"}}]}' \\\n\t--port 8123\n```\n\nResult:\n\n![Demo JSON](resources/demo-json.png)\n\n#### `--all-routes`\n\nIt will add support for GET, POST, DELETE and PATCH methods as well.\n\n```bash\ncargo server \\\n\t--all-routes \\\n\t--json '{\"id\": \"1\"}' \\\n\t--port 8123\n```\n\nResult:\n\n![Demo JSON all routes](resources/demo-all-routes.png)\n\n## --ngnix\n\nIn progress...\n\n","funding_links":["https://github.com/sponsors/raphamorim"],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphamorim%2Fcargo-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphamorim%2Fcargo-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphamorim%2Fcargo-server/lists"}