{"id":19474781,"url":"https://github.com/xigh/rust-http-server-boilerplate","last_synced_at":"2025-04-25T12:32:01.111Z","repository":{"id":148430512,"uuid":"620497818","full_name":"xigh/rust-http-server-boilerplate","owner":"xigh","description":"A simple and stupid, but working Rust HTTP Server","archived":false,"fork":false,"pushed_at":"2024-03-23T18:24:55.000Z","size":85,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T22:23:33.972Z","etag":null,"topics":["boilerplaite","hyper","mysql","rust","tokio","uptodate"],"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/xigh.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-28T19:56:04.000Z","updated_at":"2023-08-15T20:44:39.000Z","dependencies_parsed_at":"2024-11-10T19:37:05.152Z","dependency_job_id":null,"html_url":"https://github.com/xigh/rust-http-server-boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xigh%2Frust-http-server-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xigh%2Frust-http-server-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xigh%2Frust-http-server-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xigh%2Frust-http-server-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xigh","download_url":"https://codeload.github.com/xigh/rust-http-server-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250817841,"owners_count":21492237,"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":["boilerplaite","hyper","mysql","rust","tokio","uptodate"],"created_at":"2024-11-10T19:26:57.764Z","updated_at":"2025-04-25T12:32:00.483Z","avatar_url":"https://github.com/xigh.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust http server boilerplate\n\n**Without any specific http framework**\n\nThis is a simple code, written in Rust programming language.\n\n## New version (0.2.0)\n\nUpdated crates to :\n\n```toml\nhyper = { version = \"1.2.0\", features = [\"full\"] }\nhyper-util = { version = \"0.1\", features = [\"full\"] }\ntokio = { version = \"1.27.0\", features = [\"full\"] }\n```\n\n## Disclaimer (was for 0.1.0)\n\nI started to write it for my needs, and at the same time, I wanted to know how helpful it would be to develop with the help of ChatGPT4.\nPlease note that I did not asked ChatGPT4 to write the whole code, it is too complex to do that. I only asked how to use the crates I wanted to use.\nI'll write a blog article on this as soon as possible.\n\n## Why ?\n\nThe main idea with this program is to be up to date with the **latest version of all imported crates** (as of March, the 29th, 2023).\n\nI also wanted to write something light and as simple stupid as possible ! Thus there is no high level crates such as :\n\n* Rocket\n* Actix-web\n* Warp\n* Tide\n\nAll theses crates are *mindblowing* and I **strongly** recommand to use them. But this code is both for learning purpose and the felling of having fine grained control on the functionnalities.\n\n## Specs\n\n* [x] No specific framework for HTTP and routing : **Hyper** and **Tokio** only.\n* [x] **Json** support, both for encoding and decoding.\n* [x] **Mysql** support for SELECT / INSERT statements.\n* [x] Getopts to retrieve commande line parameters.\n* [x] Env_logger to log data with customized format.\n* [x] Toml to retrieve extra information from config file.\n* [x] Serves files from www directory, and specific 404 handler.\n* [x] All put in different modules. This might not be as clean as a whistle, but enough to understand how to proceed.\n\n## Todos\n\n* [ ] Upload files\n    * [ ]  unzip files\n    * [ ]  image check and resize\n    * [ ]  qrcode\n* [ ] MySQL SSL (for Azure)\n* [ ] GraphQL support\n* [ ] JWT - Json Web Token\n* [ ] Password encryption\n* [ ] Rate limiting and bandwidth control\n* [ ] Ssl support\n* [ ] Ability to send emails from templates\n* [ ] Write a simple documentation explaining how all this works\n* [ ] MongoDB support\n* [ ] PostgreSQL support\n* [ ] OpenAPI / Swagger support\n* [ ] Request to another HTTP Server / REST / GraphQL\n* [ ] Protocol Buffer\n* [ ] Websockets\n* [ ] **name yours ...**\n\n## How to use it \n\nIt requires a database. You must first prepare a `users` table with this : \n\n```mysql\nCREATE TABLE users (\n    id INT AUTO_INCREMENT PRIMARY KEY,\n    name VARCHAR(255),\n    email VARCHAR(255) UNIQUE\n);\n```\n\nAnd then copy the file `config.toml.example` to `config.toml`, editing your database parameters :\n\n```toml\n[database]\nusername = \"your_username\"\npassword = \"your_password\"\nhost = \"localhost\"\ndatabase_name = \"your_database_name\"\n```\n\nThen execute it thanks to cargo :\n\n```bash\ncargo r\n```\n\nThat's it.\n\nI hope this little code will help you. \n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxigh%2Frust-http-server-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxigh%2Frust-http-server-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxigh%2Frust-http-server-boilerplate/lists"}