All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ilcali.capture-server_2.8.1.0.0.2.source-code.Connect.scala Maven / Gradle / Ivy

The newest version!
package capture
package server

import unfiltered.request._
import unfiltered.response._

import unfiltered.netty._

case class Connect(secret: String) extends DefaultPlan with Lmxml {
  import lmxml.transforms.{ Empty, If, Value }

  val validFiles = List("lib/connect.js", "lib/control.js", "web-connect.js")

  def data = Seq(
    "connect-check" -> If (true)(Nil),
    "enable-control" -> Empty,
    "robot-key" -> Value(secret)
  )

  def intent = {
    case req @ Path("/desktop.html") =>
      req.respond(index(Resource.retrieve("index.lmxml")))
    case req @ Path(StripSlash(ValidJs(rf))) => req.respond(rf)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy