Skip to content

Instantly share code, notes, and snippets.

@XMPPwocky
Created September 14, 2015 23:27
Show Gist options
  • Save XMPPwocky/c86c834140622f3f94a3 to your computer and use it in GitHub Desktop.
Save XMPPwocky/c86c834140622f3f94a3 to your computer and use it in GitHub Desktop.
extern crate iron;
extern crate router;
extern crate logger;
use iron::prelude::*;
use iron::status;
const SITEADDRESS: &'static str = "localhost:3000";
fn main() {
let mut router = router::Router::new();
router.get("/", mainpage);
Iron::new(router).http(SITEADDRESS).unwrap();
}
fn mainpage(_req: &mut Request) -> IronResult<Response> {
Ok(Response::with((status::Ok, "Hello world!")))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment