Crates.io | tiny_file_server |
lib.rs | tiny_file_server |
version | 0.1.5 |
source | src |
created_at | 2020-12-18 20:12:39.649387 |
updated_at | 2022-11-20 07:28:55.629368 |
description | The simplest file server for the web development purposes |
homepage | |
repository | https://github.com/noogen-projects/tiny_file_server |
max_upload_size | |
id | 324429 |
size | 9,647 |
The simplest file server for web development purposes.
use env_logger::{Builder, Env};
use tiny_file_server::FileServer;
fn main() {
Builder::from_env(Env::default().default_filter_or("debug")).init();
FileServer::http("127.0.0.1:9080")
.expect("Server should be created")
.run("path/to/static/files")
.expect("Server should start");
}
To check the project, use the following command:
cargo check --all-features --all-targets
To run all tests, use the following command:
cargo test --all-features --all-targets
To check and perform formatting, use the following commands:
cargo +nightly fmt -- --check
cargo +nightly fmt
To enable autoformatting for IntelliJ IDEA with the Rust plugin:
File -> Settings -> Languages & Frameworks -> Rust -> Rustfmt, check "Run rustfmt on Save"
To run clippy, use the following command:
cargo clippy --all-targets --all-features -- -D warnings