Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaywcjlove/sgo-rs
Static file serving and directory listing
https://github.com/jaywcjlove/sgo-rs
cli http http-server rust server service
Last synced: 3 months ago
JSON representation
Static file serving and directory listing
- Host: GitHub
- URL: https://github.com/jaywcjlove/sgo-rs
- Owner: jaywcjlove
- Created: 2024-07-27T03:52:06.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-08-02T05:47:16.000Z (6 months ago)
- Last Synced: 2024-10-23T20:06:07.577Z (3 months ago)
- Topics: cli, http, http-server, rust, server, service
- Language: Rust
- Homepage:
- Size: 58.6 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README-zh.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
[English](./README.md) • [sgo](https://github.com/jaywcjlove/sgo) Nodejs
这是一款工具,旨在帮助你为静态网站、单页应用程序或静态文件提供服务,无论它们是在你的设备上还是在本地网络上。它是 [sgo](https://github.com/jaywcjlove/sgo) 的 Rust 版本,并基于 Rust 重新编写。
此外,它还提供了一个整洁的界面,用于列出目录内容:
### 使用
```sh
sgo -d target -p 3001
```### Command help
```sh
$ sgo --helpsgo - Static file serving and directory listing
Usage: sgo [OPTIONS]
Options:
-d, --dir Sets the directory to serve files from [default: ./static]
-p, --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
```
### 开发
```sh
cargo run # 运行服务器,在浏览器中打开 http://127.0.0.1:3030/
cargo build # 编译项目
cargo build --release # 编译输出发布版本cargo build --target aarch64-apple-darwin --release
cargo build --target aarch64-apple-ios --release
cargo build --target aarch64-apple-ios-sim --release
```编译输出目录
```rs
└── target
├── debug
│ └── sgo // build 输出的二进制文件
└── release
└── sgo // release 输出的二进制文件
```
### License
MIT © [Kenny Wong](https://wangchujiang.com/)