Created
September 14, 2015 23:27
-
-
Save XMPPwocky/c86c834140622f3f94a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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