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 588d2f1 + 135f952 commit 06bf5f7Copy full SHA for 06bf5f7
examples/nested.rs
@@ -0,0 +1,16 @@
1
+use async_std::task;
2
+
3
+fn main() -> Result<(), std::io::Error> {
4
+ task::block_on(async {
5
+ let mut app = tide::new();
6
+ app.at("/").get(|_| async move { "Root" });
7
+ app.at("/api").nest({
8
+ let mut api = tide::new();
9
+ api.at("/hello").get(|_| async move { "Hello, world" });
10
+ api.at("/goodbye").get(|_| async move { "Goodbye, world" });
11
+ api
12
+ });
13
+ app.listen("127.0.0.1:8080").await?;
14
+ Ok(())
15
+ })
16
+}
0 commit comments