Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Stackoverflow: [Staging Ground: Petit soucis en compilation sur Rust - Stack Overflow](https://stackoverflow.com/staging-ground/79907982)
- use iron::prelude::*;
- use iron::status;
- use iron::headers::ContentType;
- use iron::modifiers::Header;
- fn main() {
- println!("Server running at http://localhost:3000");
- Iron::new(get_form).http("localhost:3000").unwrap();
- }
- fn get_form(_req: &mut Request) -> IronResult<Response> {
- Ok(Response::with((
- status::Ok,
- Header(ContentType::html()),
- "<h1>Hello</h1>"
- )))
- }
Advertisement