diff options
Diffstat (limited to 'mavigator-server/src/main/scala/mavigator/Router.scala')
-rw-r--r-- | mavigator-server/src/main/scala/mavigator/Router.scala | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/mavigator-server/src/main/scala/mavigator/Router.scala b/mavigator-server/src/main/scala/mavigator/Router.scala index 6d442bf..c6740cc 100644 --- a/mavigator-server/src/main/scala/mavigator/Router.scala +++ b/mavigator-server/src/main/scala/mavigator/Router.scala @@ -17,14 +17,6 @@ import play.twirl.api.{ Xml, Txt, Html } object Router { - - /** Serialize Twirl `Html` to `text/html`. */ - implicit val twirlHtmlMarshaller = twirlMarshaller[Html](`text/html`) - - /** Serialize Twirl formats to `String`. */ - def twirlMarshaller[A <: AnyRef: Manifest](contentType: MediaType): ToEntityMarshaller[A] = - Marshaller.StringMarshaller.wrap(contentType)(_.toString) - import Directives._ def route(implicit system: ActorSystem): Route = ( @@ -41,17 +33,15 @@ object Router { } ~ path("dashboard" / IntNumber) { id => get { + + + //get dashboard for remote sys id ??? } } ~ path("mavlink") { get { - /*extractUpgradeToWebsocket{ upgrade => - //upgrade.handleMessagesWith(inSink: Sink[Message, _$3], outSource: Source[Message, _$4]) - ??? - }*/ - val fromWebSocket = Flow[Message].collect{ case BinaryMessage.Strict(data) => data } @@ -60,9 +50,9 @@ object Router { BinaryMessage(bytes) } - val bytes = Uav().connect() + val backend = Uav().connect() - handleWebSocketMessages(fromWebSocket via bytes via toWebSocket) + handleWebSocketMessages(fromWebSocket via backend via toWebSocket) } } ~ pathPrefix("assets") { @@ -79,4 +69,11 @@ object Router { } ) + /** Serialize Twirl `Html` to `text/html`. */ + implicit val twirlHtmlMarshaller = twirlMarshaller[Html](`text/html`) + + /** Serialize Twirl formats to `String`. */ + def twirlMarshaller[A <: AnyRef: Manifest](contentType: MediaType): ToEntityMarshaller[A] = + Marshaller.StringMarshaller.wrap(contentType)(_.toString) + } |