1
0
mirror of https://github.com/actix/actix-website synced 2024-11-27 18:12:57 +01:00

add extern crate actix_web to all samples + one missing unwrap

This commit is contained in:
DD5HT 2018-07-22 21:31:17 +02:00
parent e5efcdcd9f
commit 91eda27773

View File

@ -10,6 +10,7 @@ It is possible to serve static files with a custom path pattern and `NamedFile`.
match a path tail, we can use a `[.*]` regex. match a path tail, we can use a `[.*]` regex.
```rust ```rust
extern crate actix_web;
use std::path::PathBuf; use std::path::PathBuf;
use actix_web::{App, HttpRequest, Result, http::Method, fs::NamedFile}; use actix_web::{App, HttpRequest, Result, http::Method, fs::NamedFile};
@ -32,6 +33,7 @@ To serve files from specific directories and sub-directories, `StaticFiles` can
it will be unable to serve sub-paths. it will be unable to serve sub-paths.
```rust ```rust
extern crate actix_web;
use actix_web::{App, fs}; use actix_web::{App, fs};
fn main() { fn main() {
@ -39,6 +41,7 @@ fn main() {
.handler( .handler(
"/static", "/static",
fs::StaticFiles::new(".") fs::StaticFiles::new(".")
.unwrap()
.show_files_listing()) .show_files_listing())
.finish(); .finish();
} }