shrimple-localhost

Crates.ioshrimple-localhost
lib.rsshrimple-localhost
version5.2.0
sourcesrc
created_at2024-04-28 20:02:24.004067
updated_at2024-09-21 16:41:22.608834
descriptionZero-dependency localhost server, usable both in the terminal and in your Rust code
homepage
repositoryhttps://github.com/schvv31n/shrimple-localhost
max_upload_size
id1223512
size44,375
Tim Kurdov (its-the-shrimp)

documentation

https://docs.rs/shrimple-localhost

README

serve_current_dir()

Host your local files, e.g. for inspection by tools such as your trusty browser:

  • On any platform,
  • Without any additional dependencies,
  • Without even executing any shell commands!

Installation

Need it as a CLI?

cargo install shrimple-localhost

Need it as a library?

cargo add shrimple-localhost

Usage

CLI

Without any options, shrimple-localhost defaults to hosting the files in the current directory at the default port

shrimple-localhost
  • To specify a custom root, provide the -r flag followed by the path to the root
  • To specify a custom port, provide the -p flag followed by the port number
shrimple-localhost -p 4096 -r ~/website/static

Library

More on this in the docs of the library: https://docs.rs/shrimple-localhost

Limitations

The server to be made lightweight, thus it's very barebones; it can only handle 1 connection at once, which should be enough for what's merely a development tool.

Commit count: 15

cargo fmt