blob: e93c09b724d5a5e661b68e4613d54e11b806527c (
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
import cask.model.{Response, ParamContext}
class static(val path: String) extends Endpoint {
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)
}
|