A basic HTTP server implemented in Rust.
-
Build the project:
cargo build --release
-
Run the server:
cargo run
-
Access the server: Open your browser or use
curl
to access the server athttp://127.0.0.1:4221
.
/
: Returns a 200 OK response./echo/<message>
: Echoes back the message in the response body./user-agent
: Returns the User-Agent header from the request./files/<filename>
: Serves files from the specified directory.POST /files/<filename>
: Creates a new file with the request body in the specified directory.
This project is licensed under the MIT License.