https://github.com/devraymondsh/static-file-http-server
A simple and zero-configuration command-line http server for static file hosting
https://github.com/devraymondsh/static-file-http-server
Last synced: 10 months ago
JSON representation
A simple and zero-configuration command-line http server for static file hosting
- Host: GitHub
- URL: https://github.com/devraymondsh/static-file-http-server
- Owner: devraymondsh
- Created: 2023-02-17T12:24:23.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-04T20:21:30.000Z (about 3 years ago)
- Last Synced: 2025-08-10T22:57:09.765Z (11 months ago)
- Language: Rust
- Size: 2.69 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# static-file-http-server: a simple static server
### static-file-http-server is a simple, zero-configuration command-line static server written in Rust. It is powerful enough for production usage, but it's simple and requires not configuration. It can also produce a single binary file that hosts your files independently which is what we recommend for production.
## Installation:
### Using npm:
`npm install --global static-file-http-server`
### Using cargo:
`cargo install static-file-http-server`
## How to use:
`static-file-http-server [OPTIONS] `
## Options:
| Option(short) | Option(long) | Description | Default |
|---------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
| -a | --addr | Address to bind, for example: 0.0.0.0:80. You may need administrator permissions for binding on port 80 based on your OS. | 127.0.0.1:8085 |
| -r | --cors | Controling CORS via the 'Access-Control-Allow-Origin' header. | * |
| -c | --cache | Set cache time (in seconds) for cache-control max-age header, for eaxmple: -c10 for 10 seconds. Use -c-1 to disable caching. | 3600 |
| -o | --open | Open the browser after starting the server. | |
| -p | --single-binary | Produce a single binary that serves files that get embedded in the binary for better performance. You need to install Rust and Cargo before running this feature. (Recommend ed for production). | |
| -h | --help | Print help. | |
| -V | --version | Print version. | |