mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-20 20:55:50 +00:00
Start to stub out sub-services
This commit is contained in:
@@ -2,6 +2,11 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use futures::{future, Future};
|
||||
use hyper::{
|
||||
service::Service,
|
||||
Body,
|
||||
};
|
||||
use rouille::{
|
||||
self,
|
||||
router,
|
||||
@@ -22,6 +27,17 @@ pub struct InterfaceServer {
|
||||
server_version: &'static str,
|
||||
}
|
||||
|
||||
impl Service for InterfaceServer {
|
||||
type ReqBody = Body;
|
||||
type ResBody = Body;
|
||||
type Error = hyper::Error;
|
||||
type Future = Box<Future<Item = hyper::Response<Self::ReqBody>, Error = Self::Error> + Send>;
|
||||
|
||||
fn call(&mut self, request: hyper::Request<Self::ReqBody>) -> Self::Future {
|
||||
Box::new(future::ok(hyper::Response::new(Body::from("Hello, from interface!"))))
|
||||
}
|
||||
}
|
||||
|
||||
impl InterfaceServer {
|
||||
pub fn new(live_session: Arc<LiveSession>) -> InterfaceServer {
|
||||
InterfaceServer {
|
||||
|
||||
Reference in New Issue
Block a user