blob: 726af21a4a6051f8c998c06453b7d411ea21c197 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
package cask.endpoints
import cask.main.Endpoint
import cask.model.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)
}
|