srvr

Crates.iosrvr
lib.rssrvr
version0.1.1
sourcesrc
created_at2024-01-25 14:01:13.517778
updated_at2024-04-12 08:34:07.912567
descriptionSimple HTTP file server
homepagehttps://github.com/justim/srvr
repositoryhttps://github.com/justim/srvr
max_upload_size
id1113869
size82,150
Tim (justim)

documentation

https://github.com/justim/srvr

README

srvr

Simple HTTP file server

So simple, even the vowels are not needed

Features

  • Supports gzipped/brotlied files next to regular file
  • All files are kept in memory to reduce disk access

Usage

Local install

Via Cargo

cargo install srvr

Or use the git repo for the latest version

git clone git@github.com:justim/srvr.git
cd srvr
cargo install --path .

When the binary is available, using it is simple; everything is optional:

Serve files in a directory on a HTTP endpoint

Usage: srvr [OPTIONS] [BASE_DIR]

Arguments:
  [BASE_DIR]  The directory to serve to the world [default: .]

Options:
  -a, --address <ADDRESS>  The address to run srvr on, defaults to 127.0.0.1:12234
  -p, --port <PORT>        The port to run srvr on, defaults to 12234 (overrides `address`)
  -h, --help

Docker

Runnig with Docker is also possible; make sure to expose the port and inject a volume.

docker build --tag srvr .
docker run --rm --interactive --tty --publish 12234:80 --volume ./:/var/srvr srvr

Completions

Generating completions can be done by running the binary with the --generate-shell-completions <shell> option. There is support for bash, elvish, fish, powershell and zsh.

srvr --generate-shell-completions fish

The output of the command should be saved in the appropriate location for your shell.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Commit count: 27

cargo fmt