diff --git a/src/bin/loop_server.rs b/src/bin/loop_server.rs index f3fb3d5..2760854 100644 --- a/src/bin/loop_server.rs +++ b/src/bin/loop_server.rs @@ -3,12 +3,12 @@ extern crate hyper; extern crate lab_ebml; use futures::future::FutureResult; -use hyper::StatusCode; +use hyper::{Get, StatusCode}; use hyper::server::{Http, Request, Response, Service}; use std::env::args; use std::net::ToSocketAddrs; -const SRC_FILE: &'static [u8] = include_bytes!("../data/test1.webm"); +//const SRC_FILE: &'static [u8] = include_bytes!("../data/test1.webm"); struct WebmServer; @@ -18,7 +18,17 @@ impl Service for WebmServer { type Error = hyper::Error; type Future = FutureResult; fn call(&self, req: Request) -> Self::Future { - futures::future::ok(Response::new().with_status(StatusCode::NotFound)) + let response = match (req.method(), req.path()) { + (&Get, "/loop") => { + Response::new() + .with_body("") + }, + _ => { + Response::new() + .with_status(StatusCode::NotFound) + } + }; + futures::future::ok(response) } }