2022-02-18 03:36:04 +00:00
|
|
|
# Static Files
|
2020-05-18 01:28:47 +03:00
|
|
|
|
|
|
|
Demonstrates how to serve static files. Inside the `./static` folder you will find 2 subfolders:
|
|
|
|
|
2022-03-06 00:43:10 +00:00
|
|
|
- `root`: A tree of files that will be served at the web root `/`. This includes the `css` and `js` folders, each containing an example file.
|
|
|
|
- `images`: A list of images that will be served at `/images` path, with file listing enabled.
|
2020-05-18 01:28:47 +03:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2022-02-18 03:36:04 +00:00
|
|
|
```sh
|
|
|
|
cd basics/static-files
|
|
|
|
cargo run
|
2020-05-18 01:28:47 +03:00
|
|
|
```
|
|
|
|
|
2021-10-06 17:28:53 -04:00
|
|
|
### Available Routes
|
|
|
|
|
|
|
|
- [GET /](http://localhost:8080/)
|
|
|
|
- [GET /images](http://localhost:8080/images)
|