{"id":35001097,"url":"https://github.com/cristicretu/smolserver","last_synced_at":"2026-05-22T02:34:42.819Z","repository":{"id":203046747,"uuid":"708508178","full_name":"cristicretu/smolserver","owner":"cristicretu","description":"a minimalist http server in Rust","archived":false,"fork":false,"pushed_at":"2023-10-28T17:23:07.000Z","size":292,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-02T02:41:47.097Z","etag":null,"topics":["http-server","rust","rust-http"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cristicretu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-22T19:02:26.000Z","updated_at":"2024-05-02T02:41:47.098Z","dependencies_parsed_at":"2023-10-26T09:31:35.914Z","dependency_job_id":null,"html_url":"https://github.com/cristicretu/smolserver","commit_stats":null,"previous_names":["cristicretu/http-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cristicretu/smolserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristicretu%2Fsmolserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristicretu%2Fsmolserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristicretu%2Fsmolserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristicretu%2Fsmolserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cristicretu","download_url":"https://codeload.github.com/cristicretu/smolserver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristicretu%2Fsmolserver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33325756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T12:23:38.849Z","status":"online","status_checked_at":"2026-05-22T02:00:06.671Z","response_time":265,"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-server","rust","rust-http"],"created_at":"2025-12-27T03:52:08.423Z","updated_at":"2026-05-22T02:34:42.814Z","avatar_url":"https://github.com/cristicretu.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/cristicretu/http-server/assets/45521157/a8d228c7-45ed-4f0a-878a-9011805bbf26\" alt=\"smolserver logo\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cb\u003esmolserver - a small http-server written in Rust\u003c/b\u003e \u003cbr /\u003e\u003cbr /\u003e\n    \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\" \u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003chr /\u003e\n\n## ✨ Features\n\n- **File Handling**: Supports both reading and creating files. Perfect for file manipulation operations through HTTP requests.\n\n- **User Agent Routing**: Special handling for requests with the `User-Agent` header.\n\n- **Echo Route**: You can echo back whatever is appended to the `/echo/` endpoint, making it useful for quick tests.\n\n- **Educational**: Designed primarily as a learning exercise to understand the workings of a basic HTTP server in Rust.\n\n- **Extensible**: Despite its simplicity, the server can be further developed and integrated into larger projects.\n\n## 🛠 How It Works\n\n- **`GET /`**: Returns HTTP 200 for index routes.\n\n- **`GET /user-agent`**: Returns HTTP 200 and echoes back the `User-Agent` if present in the request headers.\n\n- **`GET /echo/{message}`**: Returns HTTP 200 and echoes back the `{message}`. For example, a GET request to `/echo/hello` would return \"hello\".\n\n- **`GET /files/{name_of_file}`**: If the file exists in the directory (provided as a command line argument), it returns the file with HTTP 200. Otherwise, returns HTTP 404.\n\n- **`POST /files/{name_of_file}`**: Creates a new file in the directory (provided as a command line argument) with the content from the request body. Returns HTTP 201 with a success message.\n\n## 💡 What to Learn\n\nThis is an excellent project to understand:\n\n- Basic HTTP protocol operations\n- Socket programming in Rust\n- Multi-threading\n- File I/O\n- Simple routing logic\n\n\n## 📜 License\n\nThis project is open-sourced under the MIT license. See [the License file](LICENSE) for more information. Free forever.\n\nHappy coding! 🦀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcristicretu%2Fsmolserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcristicretu%2Fsmolserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcristicretu%2Fsmolserver/lists"}