2018-04-16 22:38:29 +02:00
|
|
|
# static_index
|
2020-05-18 00:28:47 +02:00
|
|
|
|
|
|
|
Demonstrates how to serve static files. Inside the `./static` folder you will find 2 subfolders:
|
|
|
|
|
|
|
|
* `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.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```bash
|
2021-10-06 23:28:53 +02:00
|
|
|
$ cd basics/static_index
|
2020-05-18 00:28:47 +02:00
|
|
|
$ cargo run
|
|
|
|
```
|
|
|
|
|
2021-10-06 23:28:53 +02:00
|
|
|
### Available Routes
|
|
|
|
|
|
|
|
- [GET /](http://localhost:8080/)
|
|
|
|
- [GET /images](http://localhost:8080/images)
|
|
|
|
|