diff --git a/src/main.rs b/src/main.rs index 0ac1fc7..bafacb7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,9 @@ #[macro_use] extern crate diesel; #[macro_use] extern crate diesel_codegen; +#[macro_use] extern crate lazy_static; extern crate clap; +extern crate futures; extern crate hyper; use std::net::SocketAddr; diff --git a/src/site.rs b/src/site.rs index 005a3d9..7ed06fd 100644 --- a/src/site.rs +++ b/src/site.rs @@ -1,8 +1,13 @@ -extern crate futures; - +use futures::{self, Future}; use hyper; +use hyper::header::ContentType; +use hyper::mime; use hyper::server::*; +lazy_static! { + static ref TEXT_HTML: mime::Mime = "text/html;charset=utf-8".parse().unwrap(); +} + pub struct Site { } @@ -13,6 +18,11 @@ impl Service for Site { type Future = futures::BoxFuture; fn call(&self, _req: Request) -> Self::Future { - unimplemented!() + futures::finished( + Response::new() + .with_header(ContentType(TEXT_HTML.clone())) + .with_body(format!("WOOOOOOOOOOT!")) + .with_status(hyper::StatusCode::Ok) + ).boxed() } }