iron 0.1.2

Extensible, Concurrency Focused Web Development in Rust.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
extern crate iron;

use iron::prelude::*;
use iron::modifiers::Redirect;
use iron::{Url, status};

fn main() {
    let url = Url::parse("http://rust-lang.org").unwrap();

    Iron::new(move |&: _: &mut Request | {
        Ok(Response::with((status::Found, Redirect(url.clone()))))
    }).listen("localhost:3000").unwrap();
    println!("On 3000");
}