Skip to content

Commit

Permalink
add a comment to the serve_file to fix confusion mentioned in issue #796
Browse files Browse the repository at this point in the history


# Conflicts:
#	examples/static_file.rs
  • Loading branch information
mendelt committed Nov 28, 2021
1 parent 4be9062 commit 1b59bf7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/static_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ async fn main() -> Result<(), std::io::Error> {
let mut app = tide::new();
app.at("/").get(|_| async { Ok("visit /src/*") });
app.at("/src/*").serve_dir("src/")?;

// 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.
app.at("/example").serve_file("examples/static_file.html")?;

app.listen("127.0.0.1:8080").await?;
Ok(())
}

0 comments on commit 1b59bf7

Please sign in to comment.