| Crates.io | rustatic |
| lib.rs | rustatic |
| version | 0.2.7 |
| created_at | 2023-07-12 06:06:36.297046+00 |
| updated_at | 2025-03-06 07:36:31.277606+00 |
| description | Web server for static site used primarily locally during development |
| homepage | https://rustatic.code-maven.com/ |
| repository | https://github.com/szabgab/rustatic/ |
| max_upload_size | |
| id | 914295 |
| size | 26,973 |
When locally developing a static web site it can be quite useful to be able to run a small web server and be able to see the results.
Rustatic provides this service.
Then run
rustatic
or with more parameters run:
rustatic --indexfile index.html --nice --host 127.0.0.1 --port 5000 --path /path/to/html
Every command line parameter has a default value
--path defaults to the current directory
--host defaults to 127.0.0.1
--port defaults to 5000
--indexfile defaults to nothing. If provided then accessing a directory will yield the contenct of this file. Usually people have --indexfile index.html.
--nice Server .html files with the extension. If the user accessed /path/page rustatic will return the /path/page.html file.
rustatic using the following command:cargo install rustatic
rustatic --help
rustatic --version
rustatic --path /path/to/html --host 127.0.0.1 --port 5000
If you would like to help with the development of rustatic you can clone the repo and run the program without further installation:
git clone https://github.com/szabgab/rustatic
cd rustatic
It is recommended to set up the pre-commit hooks:
Install pre-commit
In the rustatic folder run pre-commit install.
Then you can run the command like this:
cargo run -- --help
cargo run -- --version
cargo run -- --indexfile index.html --nice --host 127.0.0.1 --port 5000 --path /path/to/html
git add .git commit -m "update version to v0.2.7"git tag -a v0.2.7 -m "publish version v0.2.7"git push --tagscargo publish