We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4be9062 + 1b59bf7 commit 3ed28daCopy full SHA for 3ed28da
examples/static_file.rs
@@ -4,7 +4,10 @@ async fn main() -> Result<(), std::io::Error> {
4
let mut app = tide::new();
5
app.at("/").get(|_| async { Ok("visit /src/*") });
6
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.
9
app.at("/example").serve_file("examples/static_file.html")?;
10
11
app.listen("127.0.0.1:8080").await?;
12
Ok(())
13
}
0 commit comments