A simple web server to serve static websites. Built with Rust as a fun project to explore web server concepts and learn Rust.
- Serves static websites from a specified folder.
- Configurable host and port.
- Optional development mode for debug logs and hot-reload.
To build and run this program, you need:
- Rust (Latest stable version recommended)
- Cargo (included with Rust)
Clone the repository and navigate to the project directory:
git clone https://github.com/your-username/BoringWebServer.git
cd BoringWebServerBuild the project:
cargo build --releaseRun the server using the following syntax:
./BoringWebServer --path [folder containing the website] -i [index file] -h [host] -p [port] --dev--path(Required) Path to the folder containing the static website files.-i, --index(Defaultindex.html) Path to the index.html file.-h, --hostSpecify the host address (e.g.127.0.0.1or0.0.0.0).-p, --portSpecify the port number (e.g.,8080).--dev(Optional) Enables development mode with debug logs and hot-reload.
To serve a website at http://localhost:8080 with debug mode enabled:
./BoringWebServer --path ./my-website -i ./my-website/index.html -h 127.0.0.1 -p 8080 --devIn development mode (--dev)
- Debug logs provide a more detailed information about requests.
- Enables Hot-reloading.
This server was designed with simplicity in mind. It doesn’t aim to compete with real web servers like Nginx or Apache; instead, it serves as a fun exercise to learn Rust.