blob: a9b319364574f06022cd3c1e10e5de644636d67c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
package cask.endpoints
import cask.internal.Router
import cask.main.{Endpoint, HttpDecorator}
import cask.model.{ParamContext, Response}
class static(val path: String) extends Endpoint with HttpDecorator{
type Output = String
val methods = Seq("get")
type Input = Seq[String]
type InputParser[T] = QueryParamReader[T]
override def subpath = true
def wrapFunction(ctx: ParamContext, delegate: Delegate): Returned = {
delegate(Map()).map(t => cask.model.Static(t + "/" + ctx.remaining.mkString("/")))
}
def wrapPathSegment(s: String): Input = Seq(s)
}
|