Skip to content

Commit 1b59bf7

Browse files
committed
add a comment to the serve_file to fix confusion mentioned in issue #796
# Conflicts: # examples/static_file.rs
1 parent 4be9062 commit 1b59bf7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

examples/static_file.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ async fn main() -> Result<(), std::io::Error> {
44
let mut app = tide::new();
55
app.at("/").get(|_| async { Ok("visit /src/*") });
66
app.at("/src/*").serve_dir("src/")?;
7+
8+
// Make sure examples/static_file.html is available relative to the current-dir this example is run from or replace this with an absolute path.
79
app.at("/example").serve_file("examples/static_file.html")?;
10+
811
app.listen("127.0.0.1:8080").await?;
912
Ok(())
1013
}

0 commit comments

Comments
 (0)