blob: 2548f79c7b75a57c71030512a465c37804504f12 (
plain) (
tree)
|
|
package example
import xyz.driver.core.init
object Main extends init.SimpleHttpApp {
lazy val fs = this.storage("data")
override def applicationRoute = path("data" / Segment) { key =>
post {
entity(as[Array[Byte]]) { value =>
complete(fs.uploadContent(key, value))
}
} ~ get {
rejectEmptyResponse{
complete(fs.content(key))
}
}
}
}
|