File tree Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change 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
- } )
1
+ #[ async_std:: main]
2
+ async fn main ( ) -> Result < ( ) , std:: io:: Error > {
3
+ let mut app = tide:: new ( ) ;
4
+ app. at ( "/" ) . get ( |_| async move { Ok ( "Root" ) } ) ;
5
+ app. at ( "/api" ) . nest ( {
6
+ let mut api = tide:: new ( ) ;
7
+ api. at ( "/hello" ) . get ( |_| async move { Ok ( "Hello, world" ) } ) ;
8
+ api. at ( "/goodbye" ) . get ( |_| async move { Ok ( "Goodbye, world" ) } ) ;
9
+ api
10
+ } ) ;
11
+ app. listen ( "127.0.0.1:8080" ) . await ?;
12
+ Ok ( ( ) )
16
13
}
You can’t perform that action at this time.
0 commit comments