extern crate iron;
extern crate staticfile;

use iron::Iron;

use staticfile::Static;

use std::env;

fn main() {
    let port = env::args().nth(1).unwrap_or("80".to_string());
    let addr = format!("localhost:{}", port);

    println!("Listening on port {}", port);
    Iron::new(Static::new(".")).http(&*addr).unwrap();
}

extern crate iron;
extern crate staticfile;

use iron::Iron;

use staticfile::Static;

use std::env;

fn main() {
    let default_port = "8080".to_string();
    let port = env::args().nth(1).unwrap_or(default_port);
    let addr = format!("localhost:{}", port);

    println!("Listening on port {}", port);
    Iron::new(Static::new(".")).http(&*addr).unwrap();
}

Change default port to 8080
Change default port to 8080

Port 80 as a default requires you to run `sudo`. This changes the
default port to 8080 which doesn't require sudo privileges to run.
