Skip to content

Gurwi30/BoringWebServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BoringWebServer

A simple web server to serve static websites. Built with Rust as a fun project to explore web server concepts and learn Rust.

⚠️ Disclaimer: This web server is not intended for real-world use or production environments. It was created purely for educational purposes and to learn more about Rust.

Features

  • Serves static websites from a specified folder.
  • Configurable host and port.
  • Optional development mode for debug logs and hot-reload.

Getting Started

Prerequisites

To build and run this program, you need:

  • Rust (Latest stable version recommended)
  • Cargo (included with Rust)

Installation

Clone the repository and navigate to the project directory:

git clone https://github.com/your-username/BoringWebServer.git
cd BoringWebServer

Build the project:

cargo build --release

Usage

Run the server using the following syntax:

./BoringWebServer --path [folder containing the website] -i [index file] -h [host] -p [port] --dev

Options

  • --path (Required) Path to the folder containing the static website files.
  • -i, --index (Default index.html) Path to the index.html file.
  • -h, --host Specify the host address (e.g. 127.0.0.1 or 0.0.0.0).
  • -p, --port Specify the port number (e.g., 8080).
  • --dev (Optional) Enables development mode with debug logs and hot-reload.

Example

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 --dev

Development Mode

In development mode (--dev)

  • Debug logs provide a more detailed information about requests.
  • Enables Hot-reloading.

Why "BoringWebServer"?

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.

About

A Simple and light weigth WebServer

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages