Example of building a web service and client with Iron and Hyper


#1

I needed to create a web service and client that speak JSON and I wrote down my process of figuring out how to use Iron and Hyper. Maybe it will be of interest to somebody.


#2

I sit here waiting a while expecting it to print “On 3000” but it never does. Cargo
must be capturing output.

I believe Iron::new(hello_world).http("localhost:3000").unwrap(); blocks.


#3

Thanks for post! Waiting long time for tutorials for Rust + Web


#4

Yea it has to, because when the main thread would reach the end of main, then all remaining threads would get exited, which means the webserver would die instantly.


#5

Nice tutorial!

If you are looking for a template engine for Iron to create server-rendered web pages, here is my handlebars-iron for you:


#6

@sunng thanks for the link!