This is a tool designed to help you serve static websites, single-page applications, or static files, whether they are on your device or on a local network. It is the Rust version of sgo, rewritten in Rust.
Additionally, it provides a neat interface for listing directory contents:
![sgo](https://private-user-images.githubusercontent.com/1680273/352696549-76797b83-0ff4-45da-bacf-114c1af1f16d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMwNjYyODUsIm5iZiI6MTcyMzA2NTk4NSwicGF0aCI6Ii8xNjgwMjczLzM1MjY5NjU0OS03Njc5N2I4My0wZmY0LTQ1ZGEtYmFjZi0xMTRjMWFmMWYxNmQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MDdUMjEyNjI1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NmI5NjQyNWFlNGZjODZiNDhhMjg1NDYzMjk2NmVlZjRiOWUyMTZkOGIxNjcxYzc3ZmY3NzIzM2VjMDI4NzQzMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.84LBXf9iO4xWhfH5ybIydCWdpudA7zmAqHt-1x1qmzc)
sgo -d target -p 3001
$ sgo --help
sgo - Static file serving and directory listing
Usage: sgo [OPTIONS]
Options:
-d, --dir <DIRECTORY> Sets the directory to serve files from [default: ./static]
-p, --port <PORT> Sets the port number to listen on [default: 3030]
-L, --no-request-logging Do not log any request information to the console
-C, --cors Enable CORS, sets `Access-Control-Allow-Origin` to `*`
-h, --help Print help
-V, --version Print version
cargo run # Run the server, open http://127.0.0.1:3030/ in the browser
cargo build # Compile the project
cargo build --release # Compile the release version
cargo build --target aarch64-apple-darwin --release
cargo build --target aarch64-apple-ios --release
cargo build --target aarch64-apple-ios-sim --release
Compilation output directory
└── target
├── debug
│ └── sgo // Binary file output from build
└── release
└── sgo // Binary file output from release
MIT © Kenny Wong