mirror of https://github.com/http-rs/tide
add serve_file to example
This commit is contained in:
parent
f1a82385ae
commit
a4a9e57a2e
|
@ -0,0 +1,6 @@
|
|||
<html>
|
||||
<head><title>Example</title></head>
|
||||
<body>
|
||||
<h1>Example</h1>
|
||||
</body>
|
||||
</html>
|
|
@ -4,6 +4,7 @@ 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/")?;
|
||||
app.at("/example").serve_file("examples/static_file.html")?;
|
||||
app.listen("127.0.0.1:8080").await?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue