#web-server #directory #http #server #python #static

app webdir

A simple HTTP web server to serve directory

3 releases

0.1.2 Apr 1, 2023
0.1.1 Apr 1, 2023
0.1.0 Apr 1, 2023

#2891 in Command line utilities

Download history 2/week @ 2024-02-17 31/week @ 2024-02-24 1/week @ 2024-03-02 37/week @ 2024-03-30 3/week @ 2024-04-06 120/week @ 2024-04-20

120 downloads per month

Custom license

38KB
163 lines

webdir

webdir is a simple Rust program that serves directory files in a HTTP web server. It's designed to be similar to Python's built-in http.server module.

Features

  • Serves files from a specified directory
  • Customizable port number and bind address

Installation

You can install webdir using Cargo, the Rust package manager:

cargo install webdir

Usage

To start the server, run the following command:

webdir

By default, the server will listen on port 8000 and bind to all available interfaces.

You can specify a custom port number using the -p or --port option:

 webdir -p 8080

You can specify a custom bind address using the -b or --bind option:

webdir --bind 127.0.0.1

You can specify a custom directory to serve using the -d or --dir option:

 webdir --dir /path/to/directory

Why webdir?

There are other similar crates in Rust for serving directories over HTTP, but I found them to be too complex and unnecessary for simple directory serving purposes. I created webdir for my personal use as a lightweight and easy-to-use alternative to those crates. Feel free to use it if you find it useful.

Contributing

If you find any issues or have any suggestions for improvements, feel free to open an issue or submit a pull request.

Dependencies