1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 06:39:22 +02:00

added StaticFiles::inex_file config

This commit is contained in:
Nikolay Kim
2018-01-29 03:23:45 -08:00
parent 456fd1364a
commit b6a394a113
4 changed files with 46 additions and 5 deletions

View File

@ -55,7 +55,8 @@ fn main() {
// websocket route
.resource("/ws/", |r| r.method(Method::GET).f(ws_index))
// static files
.handler("/", fs::StaticFiles::new("../static/", true)))
.handler("/", fs::StaticFiles::new("../static/", true)
.index_file("index.html")))
// start http server on 127.0.0.1:8080
.bind("127.0.0.1:8080").unwrap()
.start();