1
0
mirror of https://github.com/actix/examples synced 2024-11-23 22:41:07 +01:00
examples/static_index
Pieter Frenssen bc6f614f78
Improve the static files example. (#317)
* Improve the static files example.

* Replace the broken websocket example with a simple static HTML page.
* Show how to serve a second directory which is located inside the main
  directory but has file listing enabled.
* Demonstrate that a hierarchy of static files can be served by placing the
  JS and CSS files in their respective subfolders.
* Document how to use the example in the README.

* Improve formatting.
2020-05-18 07:28:47 +09:00
..
src Improve the static files example. (#317) 2020-05-18 07:28:47 +09:00
static Improve the static files example. (#317) 2020-05-18 07:28:47 +09:00
.gitattributes Adding first draft of static index example 2018-04-16 16:38:29 -04:00
Cargo.toml part3: Update dependencies 2020-04-08 01:18:52 +09:00
README.md Improve the static files example. (#317) 2020-05-18 07:28:47 +09:00

static_index

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

$ cd examples/static_index
$ cargo run

This will start the server on port 8080, it can be viewed at http://localhost:8080.