File tree 7 files changed +19
-0
lines changed 7 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -12,3 +12,16 @@ The HTTP implementation based on mio_ and rotor_.
12
12
.. _mio : https://crates.io/crates/mio
13
13
.. _rotor : https://github.com/tailhook/rotor
14
14
.. _libraries and apps using rotor : http://rotor.readthedocs.org/en/latest/ecosystem.html
15
+
16
+
17
+ Examples
18
+ --------
19
+
20
+ You can find some examples in the `examples folder `_.
21
+
22
+ To run one of them (like `hello_world_server.rs `_)::
23
+
24
+ cargo run --example hello_world_server
25
+
26
+ .. _examples folder : ./examples
27
+ .. _hello_world_server.rs : ./examples/hello_world_server.rs
Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ impl Server for HelloWorld {
111
111
}
112
112
113
113
fn main ( ) {
114
+ println ! ( "Starting http server on http://127.0.0.1:3000/" ) ;
114
115
let event_loop = rotor:: Loop :: new ( & rotor:: Config :: new ( ) ) . unwrap ( ) ;
115
116
let mut loop_inst = event_loop. instantiate ( Context {
116
117
counter : 0 ,
Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ impl Server for HelloWorld {
113
113
}
114
114
115
115
fn main ( ) {
116
+ println ! ( "Starting http server on http://127.0.0.1:3000/" ) ;
116
117
let lst = TcpListener :: bind ( & "127.0.0.1:3000" . parse ( ) . unwrap ( ) ) . unwrap ( ) ;
117
118
let threads = env:: var ( "THREADS" ) . unwrap_or ( "2" . to_string ( ) )
118
119
. parse ( ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ impl Server for HelloWorld {
116
116
}
117
117
118
118
fn main ( ) {
119
+ println ! ( "Starting http server on http://127.0.0.1:3000/" ) ;
119
120
let threads = env:: var ( "THREADS" ) . unwrap_or ( "2" . to_string ( ) )
120
121
. parse ( ) . unwrap ( ) ;
121
122
let mut children = Vec :: new ( ) ;
Original file line number Diff line number Diff line change @@ -118,6 +118,7 @@ impl Server for HelloWorld {
118
118
}
119
119
120
120
fn main ( ) {
121
+ println ! ( "Starting http server on http://127.0.0.1:3000/" ) ;
121
122
let lst = TcpListener :: bind ( & "127.0.0.1:3000" . parse ( ) . unwrap ( ) ) . unwrap ( ) ;
122
123
let threads = env:: var ( "THREADS" ) . unwrap_or ( "2" . to_string ( ) )
123
124
. parse ( ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -292,6 +292,7 @@ impl Server for TodoBackend {
292
292
293
293
#[ cfg( feature="nightly" ) ]
294
294
fn main ( ) {
295
+ println ! ( "Starting http server on http://127.0.0.1:3000/" ) ;
295
296
let event_loop = rotor:: Loop :: new ( & rotor:: Config :: new ( ) ) . unwrap ( ) ;
296
297
let mut loop_inst = event_loop. instantiate ( Context {
297
298
last_id : 0 ,
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ impl Server for Get {
131
131
}
132
132
133
133
fn main ( ) {
134
+ println ! ( "Starting http servers on http://127.0.0.1:3000/ and http://127.0.0.1:3001/" ) ;
134
135
let lst1 = TcpListener :: bind ( & "127.0.0.1:3000" . parse ( ) . unwrap ( ) ) . unwrap ( ) ;
135
136
let lst2 = TcpListener :: bind ( & "127.0.0.1:3001" . parse ( ) . unwrap ( ) ) . unwrap ( ) ;
136
137
let event_loop = rotor:: Loop :: new ( & rotor:: Config :: new ( ) ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments