/file_server

a file server that doesn't do too much

Primary LanguageRustBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

file_server

An http file server written in rust using tokio and hyper.

How to use

Install

Bash the following commands:

git clone https://github.com/herebythere/file_server
cargo install --path file_server

Run

Bash the following command to serve files in the cwd at localhost:3000:

file_server localhost:3000

Open a browser and visit http://localhost:3000.

Implementation Details

Content-Encoding

A common expectation of file servers is to serve encoded files when requested.

File_server expects encoded files to exist alongside their unencoded counterparts.

If a request has a content-encoding header:

Content-Encoding: gzip;

File-server will serve the gzip-ed version of a requested file if available.

Otherwise it will serve the default file.

Encoded files will not be served if their unencoded counterpart does not exist.

Licence

BSD 3-Clause License