https://github.com/neorandom/rust-http-server
HTTP server made in Rust from without external libraries
https://github.com/neorandom/rust-http-server
cargo get-request http http-server multithreading rust rust-lang
Last synced: 9 months ago
JSON representation
HTTP server made in Rust from without external libraries
- Host: GitHub
- URL: https://github.com/neorandom/rust-http-server
- Owner: neoRandom
- License: mit
- Created: 2024-08-09T04:23:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-11T20:58:04.000Z (over 1 year ago)
- Last Synced: 2024-10-29T00:25:59.827Z (over 1 year ago)
- Topics: cargo, get-request, http, http-server, multithreading, rust, rust-lang
- Language: Rust
- Homepage:
- Size: 28.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HTTP Server (in Rust!)
### A server based on HTTP made with Rust from Scratch.
### Supports multithreading and (only) GET requests.
## How to use:
Make sure that you have `cargo` and `rustc` installed in your computer
Run `cargo build --release` at the cmd to build an executable
Run `.\target\release\http-server.exe` to start the server
Access `http://:7878` to see the index page
> To download a file, access the endpoint `/file`. Example: `/file/filename.ext/p=`
> This project was only tested on Windows 10.
## Types of status code:
### 2xx: Success - The action was successfully received, understood, and accepted
- 200 Ok
### 4xx Client Error - The request contains bad syntax or cannot be fulfilled
- 400 Bad Request
- 404 Not Found
## Based on:
- https://doc.rust-lang.org/book/ch20-01-single-threaded.html
- https://doc.rust-lang.org/book/ch20-02-multithreaded.html
- https://doc.rust-lang.org/book/ch20-03-graceful-shutdown-and-cleanup.html
- Lots of research to improve even more
## Licence
#### This project is currently under a [LICENSE](LICENSE)