mirror of
https://github.com/actix/actix-website
synced 2025-02-25 21:42:50 +01:00
Merge pull request #180 from vo9312/update-named-file
Update named file
This commit is contained in:
commit
10162d2576
@ -36,9 +36,10 @@ converted into an `HttpInternalServerError`:
|
|||||||
|
|
||||||
```rust
|
```rust
|
||||||
use std::io;
|
use std::io;
|
||||||
|
use actix_files::NamedFile;
|
||||||
|
|
||||||
fn index(_req: HttpRequest) -> io::Result<fs::NamedFile> {
|
fn index(_req: HttpRequest) -> io::Result<NamedFile> {
|
||||||
Ok(fs::NamedFile::open("static/index.html")?)
|
Ok(NamedFile::open("static/index.html")?)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user